Fixing bug with the image shift