bugfix for "cannot write mode P as JPEG"