gfx: handling for <4-color pngs when converting to 2bpp

without a .pal file as reference, palettes are sorted by luminance.
pokemon crystal reads palettes exactly 4 colors in length.
if an image used fewer than 4 colors, invalid palettes were produced.

instead, dummy colors are inserted to pad out the palette.
fix palette functions and output palettes in 2bpp conversion
gfx: palette checking in to_png
gfx: workable command line functions