Refactor GbaImagesFormatter

About to add the GbaLzPaletteFormatter, and realized that most of the
code from GbaImagesFormatter would be copied. Pulled all the shared code
into a utility class, and eventually ended up with only a few initial
conditions that needed to be different.