Youtube returns 404 for not existing thumbnails, but it also returns valid image data (broken video thumbnail), so checking it with Image does not work, onerror is not called:
var img = new Image();
img.onload = function() { alert("found")};
img.onerror = function() { alert("not found") };
img.src = "http://img.youtube.com/vi/aaaa/1.jpg";
When run then it says "found". Is there a way to detect 404 if the image data can actually be loaded?
It is also good if it shomehow can be detected that the link returns the standard youtube "broken video" thumbnail image data.