colorPalette: try checking imagesize before invoking GD