Don't assume first colour palette will have 256 colours.  Fixes bug #723140.