Better handling of different RGB image encodings