Image files may be locked depending on how they are displayed. In this example, the CacheOption property of BitmapImage is set to BitmapCacheOption.OnLoad. This caches the image in memory when it's loaded, preventing the original file from being locked.
BitmapImage bitmap = new BitmapImage();
bitmap.BeginInit();
bitmap.UriSource = new Uri(imagePath, UriKind.RelativeOrAbsolute);
bitmap.CacheOption = BitmapCacheOption.OnLoad;
bitmap.EndInit();
imageControl.Source = bitmap;