Add support for 24-bit RGBTRUECOLOUR. Fixes some bad logic in ImageMask when there are multiple bands.

Also some minor cleanups in VQ code.
Fix and cleanup the masked pixel.