Thanks for the help, but it still doesn't seem to work right.
the random image needs to load in the same window, not a popup. When the random image loads thought, once you click on it, then that url will open up in a new window. I don't know if that makes sense or not.
anyway, thanks for your help.