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.
Are they all in the same directory? If so it may be worth getting the list of files and storing them in a hash and comparing against that rather than all the file_exists lookups.