if they come from a database, you could use mysql's rand(), than some html to refresh the page, or sessions to track what you have shown and increment once on every refresh,
<meta http-equiv="refresh" content="5">
unless you wanted just the image to change, in which case you'll have to look into javascript
..
there are lots of really simple javascript slide shows that toggle through images where you can create the list of images dynamically from the database