When displaying images on our website, we check if the file exists with a call to file_exists(). We fall back to a dummy image if the file was missing.
file_exists()
Howe
If you want to check existence of an image file, a much faster way is to use getimagesize !
Faster locally and remotely!
if(!@GetImageSize($image_path_or_url)) // False means no imagefile { // Do something }