bugfix in RGBA to greyscale conversion