Error setting metadata of image

Do not crash if inserting an image in a format that does not
support metadata. The first part of this fix is in libpalaso.