Resolved issue with leaking file descriptors when file does not have a valid EXIF format or orientation flag