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
file_exists() should be a very inexpensive operation. Note too that file_exists builds its own cache to help with performance.
file_exists
See: http://php.net/manual/en/function.file-exists.php