Fixed gradient image mapper behavior at boundaries of the image.