It works fine everywhere but not in IE 11 (I have not tested other IE versions yet).
var img = new Image();
img.onload = function(){
alert( \'img: \' + i
In html5 standard:
The IDL attributes width and height must return the rendered width and height of the image, in CSS pixels, if the image is being rendered, and is being rendered to a visual medium; or else the intrinsic width and height of the image, in CSS pixels, if the image is available but not being rendered to a visual medium; or else 0, if the image is not available. LINK
If img not rendered then IE reserves the right to display 0. And it seems he is doing this.
With .naturalWidth and .naturalHeight similar situation.