Fixed problem with offset on reference image