Refactored ToGrayscale. No for-loop
Merge fix