Reoccuring images after clicking thumbnails, HELP!

I have a small gallery on my flash site and I’ll click an image, it’ll open, and then the code I have is set so that if you click anywhere the image will close.

Now, if I click on a second thumnbail (after closing the first image), not only will the second image open but the first one as well!

Can anyone help me so that it just opens the thumbnail clicked!?

Thx