title: GetGeotagAsync fails on files from a list created via Folder.CreateFileQueryWithOptions w/ OrderByName
body: <p>Objective: get a list of image files from a user specified folder and retrieve the latitude/longitude metadata for each file if available.</p>
  
  <p>The approach is to use Folder query with options to return a list of files which are then iterated over to get the geotag info. As a simple test I just added some code to the Geotag sample provided by MS; ChooseFolderButton_Click method added. It uses FolderPicker then simply picks the first file from the query (just as a test) and treats it like the original demo does to display geotag info.</p>
  
  <p>The problem appears to be with how the StorageFile items are returned from the query AND only when CommonFileQuery.OrderByName is used. If DefaultQuery is used then all works.</p>
  
  <p>Here is the code added to MS Samples Geotag (a button was added to the XAML):</p>
  
  <pre><code>private async void ChooseFolderButton_Click()
  {
      FolderPicker picker = new FolderPicker
      {
          SuggestedStartLocation = PickerLocationId.PicturesLibrary,
          CommitButtonText = "Select",
          ViewMode = PickerViewMode.Thumbnail,
      };
      picker.FileTypeFilter.Add("*");
      StorageFolder Folder = await picker.PickSingleFolderAsync();
  
      if (Folder != null) { 
          // Get the files and sort them myself
          IReadOnlyList&lt;StorageFile&gt; files = await Folder.GetFilesAsync();
          List&lt;StorageFile&gt; sortedList = files.Where(f =&gt; string.Compare(f.FileType,".jpg", ignoreCase: true) == 0 )
                                                  .OrderBy(f =&gt; f.DisplayName)
                                                  .Select(f =&gt; f)
                                                  .ToList();
          file = sortedList.FirstOrDefault();
      }
  
      if (Folder != null) {
          // Use Folder GetFiles with query options to get sorted list
          var queryOptions = new QueryOptions(CommonFileQuery.DefaultQuery, new List&lt;string&gt; { ".jpg" })
          {
              FolderDepth = FolderDepth.Shallow
          };
              //queryOptions.SetPropertyPrefetch(PropertyPrefetchOptions.ImageProperties, null);
          IReadOnlyList&lt;StorageFile&gt; files2 = await Folder.CreateFileQueryWithOptions(queryOptions).GetFilesAsync();
          var file2 = files2[0];
      }
  
      if (Folder != null &amp;&amp; file != null)
      {
          FileDisplayName.Text = file.DisplayName;
          FileOperationsPanel.Visibility = Visibility.Visible;
      }
      else
      {
          FileOperationsPanel.Visibility = Visibility.Collapsed;
      }
  }
  </code></pre>
  
  <p>Selecting the file from sortedList works fine. Using the result from files2 will also work when DefaultQuery is used as shown. Change it to OrderByName and the GetGeotagAsync call will fail, returning null.</p>
  
  <p>Looking into it in detail, it appears the StorageFile instance returned is different in this last case.  The FolderRelativeId has the file extension duplicated; numbers\filename.ext.ext ; however, access through the StorageFile instance seems to work otherwise... except for GetGeotagAsync() at a minimum. This makes me wonder if a copy of the files are being created and the metadata is not included.</p>
  
  <p>I am relatively new to C# and UWP and this is my first question post so I hope this is enough detail... The Question is basically: Am I missing something here? Doing something wrong in the Folder Query? I can work around it using linq as I did in the example code, or even just use DefaultQuery; yet this is uncomfortable as I do use the folder query approach in several other things. Does query OrderByName duplicate or do something undesireable?</p>