There might be. However, I have a version of this script where, if an image is clicked before all the others are loaded, before the page is loaded even, it still works as expected. I believe this to be a better approach. Try it out:
The update was introduced here:
You can copy the script code from there or download it from this link to the script (right click and 'Save As'):
BTW, I also changed the DOCTYPE to a standards invoking one in order to get hte page to render properly in some browsers where it was not doing so.
Any questions, just ask.