fix texture corruption

a couple of stupid bugs. Very stupid bugs.
Discovered much like Sudden Clarity Clarence :)
dump the palette of a texture