You can grab the files, then randomly (or however else you want to select, from an array, etc.) display your pics outputing the thumbnail size in html.. If you want to really reize the image your outputting (faster downloads) you will need the gd package on your server and then "image generate" the new sizes..
See this old DevShed article I archived for reference..
http://sharea.net/cw/PHP4/PHPTUTFTP2.mht