Use API function for png error handling rather than directly accessing data members

12 jobs for 3-jpeg-warning-premature-end-of-jpeg-file in 50 minutes and 13 seconds (queued for 6 seconds)