Fixes issue with 8-bit images