Create a new directory and place all of the gif files in there that you want in the rotation. Upload avatar.php and htaccess.txt to the folder. Once uploaded, rename avatar.php to avatar.gif (this makes sure it's uploaded in ASCII) and rename htaccess.txt to .htaccess (since Windows won't allow you to have this kind of name for a file).
The avatar.gif file will now load a random image from the folder everytime it is requested.