 autorefresh of image saves first image taken
<p>i have a camera that saves jpeg pictures which i then upload on my webpage. im using this javsacript code to do autorefresh:</p>

<pre><code>function refreshCam()
{   
    document.getElementById("cameraImg").src = "cameraImg.jpeg?a=" + String(new Date().getMilliseconds());
    setTimeout("refreshCam()",500);
}
</code></pre>

<p>however, the very first image i took pops up in between successive image displays. 
whats worse is that even when i turn off the camera so that no more new images are saved, the picture displayed still continues to change. how do i remove this behavior permanently?</p>
