Fix regression causing incorrect image data to be stored in the oldimage table.