Speed improvements to GetGradientImageInfo