Adding PNG paletted saving
Avoiding too much "palette" saving. Checking that the image is not out of palette bounds.