Why don't you just use this script:
code:
<?php
$dir = "imgs";
$dh = opendir($dir);
$files = array();
while (false !== ($filename = readdir($dh))) {
$files[] = $filename;
}
sort($files);
array_splice($files, 0, 2);
srand( (double) microtime()*1000000 );
$key = array_rand($files);
readfile($dir . "/" . $files[$key]);
?>
Make a folder called "avatar" on your server, for example
http://skarz.co.uk/avatar/ then in that folder put that code in a .php file (this is where you will link the image to, ie.
http://skarz.co.uk/avatar/random.php will go in the avatar url box in the user cp). The images that you want shown should go in the "imgs" folder:
http://skarz.co.uk/avatar/imgs.
I doubt it would be that hard to just make seperate folders for different people. You can't be hosting that many people
.