Fix grayscale conversion code to match libjpegs YUV