I think what you are trying to do is change the image dynamically. You can read image to memory, and use that instead of the actual file. Read the file into memory, use it as the source for the image, and then do any changes to the original file:
Bitmap bitmap = new Bitmap(@"C:\temp\FoxLogo.png");
IntPtr hBitmap = bitmap.GetHbitmap();
ImageSource wpfBitmap = Imaging.CreateBitmapSourceFromHBitmap(hBitmap, IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()); ;
img.Source = wpfBitmap;
May be a better way to do this.