Delete from oldimage, then image, to account for possible foreign keys. Bug 12520...