https://javascript.plainenglish.io/how-to-check-if-image-exists-on-the-server-using-javascript-564535efff51