Catch and log exception when an invalid JPEG is loaded