gif: changed palette lookup to a more same method