Modify the error handling when checking if big image (see #10306)