fixed index of sprites and palettes bug