Fix regression causing incorrect image data to be stored in the oldimage table.
The call to upgradeRow() in purgeMetadataCache(), indirectly called during upload, caused data for the new file to be written into the 'image' table in the database before migration from 'image' to 'oldimage'. Thus data for the new file was recorded as belonging to the old file.
Have replaced this call with a call to loadFromFile(), so the new data goes only into cache
at this time, and won't get written to the database until after.
The 'purge' action in ImagePage now explicitly calls the upgradeRow() function in addition to cache purging... is it needed elsewhere?
This whole mess still stinks of race conditions, though. Sigh.