Gradient image and _ reduce refactoring