If you can use PHP on your webserver, do this:
1. Put all images in a folder called images
2. Create a PHP file called image.php in the parent folder of the images (eg /sdf/images, would have image.php in /sdf/)
3. Insert below code into images.php
<?php
$dir = scandir("images");
if(!$dir)
{
die("Error, directory images not found");
}
$img = rand(0,count($dir) - 1);
header("Location: images/" . $dir[$img]);
?>
???
Profit