Update ImagePalette.py

According to __init__, using `len(self.mode)` might be better. Tested on my machine.