Fix bug with palette images