PDF: Optimize palette encoding

When a palette is present in a PNG image, string encoding is almost always more efficient than hex encoding.