When I put ifexist tags in a gallery in a template, they don’t work. Is there a way around this? This is an example below where I’m trying to create a gallery that shows Placeholder Horses.png images, but if a [Color] Horse.png file like one of the examples below is uploaded, it replaces the placeholder image.
Spaced them out to make it easy to read.
<gallery>
File:{{#ifexist:File:Yellow Horse.png|Yellow Horse.png|Placeholder Horses.png}}|Yellow
File:{{#ifexist:File:Blue Horse.png|Blue Horse.png|Placeholder Horses.png}}|Blue
File:{{#ifexist:File:Green Horse.png|Green Horse.png|Placeholder Horses.png}}|Green
</gallery>
Thank you in advance to anyone who may have a solution!