[qt] rendering issues for JPEG with XMP metadata

This fixes #1504 and was based on the patch by tsnyder91.