Similar to T329364, again when $wgParserEnableLegacyMediaDOM set to false
The css based magnify links should be limited to the .mw-file-description case where they're redundant. For the more uncommon case where the |link= media option is used, we'll need to consider to adding a tags to the html, probably in the figcaption similar to the legacy output.
Also, if the link is suppressed |link=| or timed media is used, so that the inner wrapping element is a <span>, the magnify isn't present at all.