BufferedPalettedRgb888Image: Fixed bounds check for color index.