fix: grayscale jpegs weren't handled correctly