Make image smaller before calculating pallete according to the configurable parameter