Bugfix: Avoid directly encoding if the sample model is not exactly right. For example, monochrome image generated by JAI (error-diffusion rasterization) use a non-packed sample model which caused badly encoded images.