From my limited knowledge of regex line 89 in upload.php should read:
$img1_name = preg_replace("/[^a-z0-9-_.]/i", "", strtolower($img1_name));
Note the addition of the -_ which allows correct renaming. This also appears to fix a problem with thumbnails coming up with the right name but the linked filename being wrong in Steve Ivy’s upload.php mod.
Someone might want to check this doesn’t cause other problems though. ??