title: Detect 404 images using Javascript
body: <p>I have in my application some references to Twitter photos.</p>
  
  <p>When the photo is no longer available on Twitter side (see this example: <a href="http://p.twimg.com/AmL3hpaCEAd2wtN.jpg">http://p.twimg.com/AmL3hpaCEAd2wtN.jpg</a>), I receive a 404 response code with an image as a body (the gray 404 image)</p>
  
  <p>I'm using <code>onload</code> and <code>onerror</code> javascript methods on Img, but since p.twimg.com is returning a body, the <code>onload</code> method is triggered. I found no way to distinguish a 404 response from a 200 one.</p>
  
  <p>Any idea?</p>