codice:
var img = new Image();
img.onerror = function(){
  alert('immagine non presente');
}
img.src = url;
ciao