I tried using this simple JavaScript function in the template to check if an image URL exists / is valid:

Code:
<script language="JavaScript">
function imageExists(url) 
{
        var img = new Image();
        img.src = url;
        return img.height != 0;
}
</script>

Then do something like this to react on the result of the check:

Code:
<script>
if ( imageExists("http://some.domain.net/snaps/$ID$.png") )
        document.write("<img src=\"http://some.domain.net/snaps/$ID$.png\">");
else
        document.write("<img src=\"$GHOST_IMAGE$\">");
</script>

Works nicely here!


A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]