Fix sign error in img offset