Some improvements in repairing and upgrading images.