added exception handling to ImageReader