Fixed import_error method, so that the errored files are correcly attached to the email message.