There is no way to determine if javascript or jQuery is used if the image exists without loading .
workaround
The only way to check if the image exists on the server side is to try loading the image into a hidden div or something else and check if this image is there or not, and then display it.
or you can use any server language of your choice, for example (php, asp, jsp, python, etc.), and send an image request to the server language (preferably using AJAX), and check the server side of the script, whether the image exists or not, and send the image if it is, or send an error code if it is missing.
source share