Prevent errors when weird images are encountered

I'm making reports with external images (so I can't anticipate whether or not the images are formatted correctly or not). But the code was previously throwing ZeroDivisionErrors and non-existent attribute errors. Instead the code should continue and render the report.