this code gives 0 as height and width for the first time it iterates and the second time gives the right dimensions
<pre><code>var icon1 = new Image();
icon1.src = resource;
var width = icon1.width;
var height = icon1.height;
</code></pre>

<p>This code when iterates gives 0 as width and height for the first time it iterates and for the second time it gives right dimensions.</p>
