I would use PHP for this. Flash and the likes are way to heavy tools to solve this relatively simple problem.
Assuming you have image1.jpg, image2.jpg, ... imageN.jpg, a simple snippet like this will do:
<img src="image<?php echo rand(1, 10); ?>.jpg" alt="" />
Or you could put all images in an array and pick one at random.
(code assumes you have 10 images)