title: UICollectionView indexPath.row or item, items not stable, jumping around
body: <p>I created a collection view and I'm loading images into it.  Problem I'm running across is when I click on a cell to get it's indexPath.item or indexPath.row, the numbers are all screwed up.  Clicking on the very first image doesn't display anything, clicking on the next will give me 0.  Clicking on the third will give me a 1, and clicking back on the second one gives me a 2.  This happens all throughout the view.  Has to be something wrong that I'm doing.  Here's my code:</p>
  
  <p>viewDidLoad:</p>
  
  <pre><code>UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc]init];
  layout.sectionInset = UIEdgeInsetsMake(10, 20, 10, 20);
  [layout setItemSize:CGSizeMake(75, 75)];
  self.images = [[UICollectionView alloc]initWithFrame:CGRectMake(0, 230, self.view.frame.size.width, 200) collectionViewLayout:layout];
  self.images.delegate = self;
  self.images.dataSource = self;
  [self.images registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cellIdentifier"];
  [self.view addSubview:self.images];
  </code></pre>
  
  <p>delegate methods:</p>
  
  <pre><code>- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
      return self.imagesGallery.count; //image paths for server
  }
  
  - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
      UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cellIdentifier" forIndexPath:indexPath];
      cell.layer.borderWidth = 1;
      cell.layer.borderColor = [[UIColor whiteColor]CGColor];
      UIImageView *image = [[UIImageView alloc]init];
      image.image = [UIImage imageWithData:[self.imagesGallery objectAtIndex:indexPath.row]];
      image.frame = CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height);
      [cell addSubview:image];
      return cell;
  }
  
  - (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath{
      NSLog(@"%d", indexPath.item);
  }
  </code></pre>
  
  <p>I'm not sure how to get exact control of what goes where.  Are they numbered normally like:</p>
  
  <pre><code>0 1 2
  3 4 5
  ....
  </code></pre>
  
  <p>Or is there a special way they get numbered based on the sections?  How do they get populated?</p>