Drawings on the site gives the script. (Or does not give).
How to correctly otshit wrong request, if there is no picture?
Is it enough just to send a 404 header?
In the headers send the code 404, mime-type: image / jpg, and the response body - a picture with the inscription "Image not found". The picture should be in jpeg format, respectively.
Then it will be nice in the browser, and it seems like, by the standard, when receiving 404 code, normal programs usually understand that the requested resource was not found)
file_exists($urlpic) returns a boolean true or false if the $ urlpic file is present or not, respectively.