The script will be called from a URL like example.com/photo.php?id=123
or example.com/photos/123
depending on if the have the pretty URLs featured enabled.
If photo #123 does not exist, a request to example.com/photos/123
should throw a 404 error. But, what about example.com/photo.php?id=123
?