Fix gallery image layout issues.
Set correct document character encoding.
Fix a plethora of malformed XML issues.