fix case where asked palette is bigger than image's
remove useless variable
ignore transparent colors