Make ImagePreviewWidget compatible with Image objects without path attribute.