Correct the reference of images