The short answer will be an attempt to open the file, if it is not executed, wait a few seconds and try again, looping until success or timeout is reached.
However, if you update these images a lot, you really stun the IIS caching mechanisms. And it's not great for a web server to serve files that are constantly changing. The web server works fine in static files.
Now, if your images are so dynamic, you may need to serve them through a server program. Create your images (or read them from another program through remote access or WCF) and submit it. Your server program may also perform some form of caching. You do not even need to store the image file if it lasts a very short time.
If you only need to replace these images from time to time, then everything is in order to try again.
Now, if these images are really important, and you really want IIS to stop serving the old version, as soon as you have a new version (are you servicing CAPTCHA?), And IIS works with the same file many times per second, then your process may you may not be able to find the slot in. Then you will need to find a way to tell IIS to stop and wait for the new version - restarting it should work, since you do not change images often (otherwise you would go with a dynamic route).
source share