Template:Exists
meta.wikimedia.org/wiki/Template:Exists
This seems to just be a more verbose version of Template:Exist.
Example[edit | hide | hide all]
{{exists|page=file:Hero Solmyr small.png|then=[[file:Hero Solmyr small.png]]|else=}}
{{exists|page=file:Hero Missingno small.gif|then=[[file:Hero Missingno small.gif]]|else=}}