Fix #236.

Monochromatic JPG images were being handled incorrectly. Now it works as
expected.