Improved palette support in BamDecoder