title: Wrong images loaded
body: <p>I was developing an UWP app. I am using UWP &quot;Image&quot; control to show images in my app. All images are loaded properly most of the time. But occasionally few images not loading properly. Sometimes it is loaded in cropped version and sometimes loaded a black box which is never set from app. My code to set image:</p>
  <p>XAML:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Image x:Name=&quot;FavoritePen&quot; 
         Source=&quot;{Binding FavPenSource, Mode=OneWay}&quot;
         Height=&quot;44&quot;
         Width=&quot;44&quot;
         Margin=&quot;0,10,10,0&quot;
         HorizontalAlignment=&quot;Center&quot; 
         VerticalAlignment=&quot;Center&quot;
         Stretch=&quot;Uniform&quot;/&gt;
  </code></pre>
  <p>CS:</p>
  <pre class="lang-cs prettyprint-override"><code>private string favPenSource = 
      &quot;ms-appx:///Assets/Images/NoteList/ic_main_tb_favorite_on.svg&quot;;
  
  public string FavPenSource
  {
      get
      {
          return favPenSource;
      }
      set
      {
          SetProperty(ref favPenSource, value);
      }
  }
  </code></pre>
  <p>Black box loaded:</p>
  <p><a href="https://i.stack.imgur.com/7aRvu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7aRvu.png" alt="Black box loaded" /></a></p>
  <p>Wrong image loaded with cropped version:</p>
  <p><a href="https://i.stack.imgur.com/UqQDj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UqQDj.png" alt="enter image description here" /></a></p>
  <p><strong>Additionally, this is a very rare case, may be 1/100 frequency.</strong></p>
  <p>I googled and tried many solutions but it didn't help. I found that some people faced same issue but didn't find a proper solution yet. (<a href="https://docs.microsoft.com/en-us/answers/questions/240931/bitmapimage-in-uwp-display-wrong-images-occasional.html" rel="nofollow noreferrer">Issue_1</a> , <a href="https://stackoverflow.com/questions/65824443/bitmapimage-in-uwp-display-wrong-images-occasionally">Issue_2</a>, <a href="https://docs.microsoft.com/en-us/answers/questions/174341/uwp-why-do-images-sometimes-load-wrong-source.html" rel="nofollow noreferrer">Issue_3</a> , <a href="https://forums.xamarin.com/discussion/153224/uwp-occasionally-an-image-will-display-the-wrong-source-using-the-bounds-of-the-correct-source" rel="nofollow noreferrer">Issue_4</a>)</p>
  <p>Can anyone please help me to solve the issue!!</p>