hmm, well to get rid of the fact that multiple images could come up, then the script gets a little longer
<?php
$dir = 'images';
$dh = opendir(dirname(__FILE__) . '/' . $dir);
while (false !== ($filename = readdir($dh))) {
if( substr($filename, -4) == '.jpg' ) {
$img[] = $filename;
}
}
for( $x = 0; $x<3; $x++ ) {
$var = rand(0,count($img));
echo '<img src="' . $dir . '' . $img[$var)] . '" />';
unset($img[$var]);
}
?>