added a small optimization to swf_ImageGetNumberOfPaletteEntries().