colorPalette: try checking imagesize before invoking GD
Merge branch 'master' into smajnr-patches