added error output for reading image size