title: ALAssetsLibrary loading a single photo from ALAssetsGroupAll
body: <p>I'm trying to build a custom image picker similar to <code>iOS</code> 7's photos app. I was able to get it to pick a photo from the Camera Roll (<code>ALAssetsGroupSavedPhotos</code>) but I'm struggling to load a single image from another album - one which I've created for testing purposes.</p>
  
  <p>Here's the code I'm using to load a photo from the camera roll:</p>
  
  <pre><code>ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
  
  [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) {
  
      [group setAssetsFilter:[ALAssetsFilter allPhotos]];
      numberOfPhotos = [group numberOfAssets];
  
      [group enumerateAssetsAtIndexes:[NSIndexSet indexSetWithIndex:index] options:0 usingBlock:^(ALAsset *alAsset, NSUInteger index, BOOL *innerStop) {
  
  
                               if (alAsset) {
  
                                   ALAssetRepresentation *representation = [alAsset defaultRepresentation];
                                   UIImage *lastImage = [UIImage imageWithCGImage:[representation fullScreenImage]];
  
  
                               }
  
                           }];
  
  }
                       failureBlock: ^(NSError *error2) {
  
  
                       }];
  </code></pre>
  
  <p>I tried to replace the <code>ALAssetsGroupSavedPhotos</code> with <code>ALAssetsGroupAll</code> but it's returning the following error:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSRangeException', reason:
    'indexSet count or lastIndex must not exceed -numberOfAssets'</p>
  </blockquote>