Merge "Fix crashes for images that are not PNG or JPEG" into klp-dev