Change sha1 to hash and add allow_pixel_shift.