This pulls a random image from a list of 5 (reload for an 80% chance of a different image). The source goes inside the body of the HTML and is appended to the end of this file.
The filenames and textual descriptions go in the arrays filename and alttext. For convenience I've also specified fileroot for a common path which gets prepended to the filename. It should work with any number of images, but make sure the arrays are the same length!
I guess you'll want to use images of the same height and width for the real version, in which case you can add width=x height=y immediately after img in the document.write command (and any other tags, of course).