you can get an array of all the images in that folder by calling the function scandir and then count the number of arrays in it and call rand function to make it randomly pick...
PHP Code:
$images = scandir('/images');
$img_num = count($images);
$rand = rand(2,$img_num); //min is 2 because scandir includes current directory and the directory above
echo "<img src={$images[$rand]}>";