<!--This is just a template - feel free to delete any and all of it and replace as appropriate.--> ### Description A System.NullReferenceException was throwing when get a **gif** image using Image.FromFile() method. [CallStack.txt](https://github.com/dotnet/winforms/files/6685418/CallStack.txt) **Expected behavior:** The **gif** image should get using Image.FromFile() method correctly. **Minimal repro:** 1. Create a WinForms .NET core project targeting .NET 6.0 2. Add following code to the structure method of Form1 `Image.FromFile(@"\\ServerName\Images\animated.gif");` Below is the animated.gif file:  3. Build and run the project ### Configuration .NET SDK 6.0.100-preview.7.21320.4 ### Regression? Yes, this is a regression issue. ### Other information This issue doesn't repro when file was saved on a local path