Adding a security measure to avoid crashes during file import

As described here http://forum.adamslair.net/viewtopic.php?f=18&t=292&start=10#p1223

in some cases the editor will crash while trying to import, for example, a malformed image file.
This fixes the issue by trapping the error and logging the exception in the editor's log.