Fixed bug in repair for images.
Merge branch 'test' into dev