Added exception handlers for IOErrors from corrupted JPEGs.