<?php
mt_srand((double)microtime() * 1000000);
$images = array(
'img01.gif',
'img02.gif',
'img03.gif'
);
$random = $images[mt_rand(0, count($images) - 1];
$path_to_image = 'images/' . $random;
$fp = fopen($path_to_image, 'r');
$contents = fread($fp, filesize($path_to_image));
header('Content-type: image/gif');
header('Content-Disposition: inline; filename=' . $random . '.gif');
print $contents;
?>