Fixed bug in repair for images.