i was thinking something along these lines
if ($_FILES['imagefile']['type'] == "image/gif") {$ft[ext]="gif";}
If ($_FILES['imagefile']['type'] == "image/pjpeg") {$ft[ext]="jpg";}
$nn = time();
$nn = $nn."."."$ft[ext]";
$nn being new name
all the files being uploaded are jpg, or gif
then I download the files, and sort through them, so sorting them wile on the server isn't a big deal, just when I download them (which my PC can handle OK)