private static BitmapImage LoadBitmapImage(string filename) {
var bi = new BitmapImage();
bi.BeginInit();
bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
bi.CacheOption = BitmapCacheOption.OnLoad;
bi.UriSource = new Uri(filename);
bi.EndInit();
bi.Freeze();
return bi;
}