fixed grayscale generation from sdl_surface