title: UICollectionView showing wrong layer when scrolling
body: <p>I know it's pretty common question. I've seen number of people ask here this type of a question, but I still can't seem to get it right.</p>
  
  <p>I have a UICollectionView with pictures. I'm the getting the images from facebook so I'm using SDWebImage to load them.</p>
  
  <p>Until here everything works ok. </p>
  
  <p>The user can upload pictures that he took. so until the uploading process is finished and image was uploaded to facebook, I want the local image to be shown but with a layer (different alpha, activity etc') and once i get a notification from the server, the new image from facebook is replacing the local one.</p>
  
  <p>My problem is that after adding the local images to the collectioView with the layer, more cells are displaying this layer and from time to time when i scroll up , the new images changes.</p>
  
  <pre><code>- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
  {
  
      PictureCell* cell = (PictureCell *)[_collectionView dequeueReusableCellWithReuseIdentifier:[PictureCell reuseIdentifier] forIndexPath:indexPath];
  
      Picture *picture=(Picture *)[_campaign.pictures objectAtIndex:indexPath.row];
  
  
      //If the picture is being uploaded, add the image from the local image property and set the blur layer
  
      if (!picture.facebookPicture) {
          cell.pictureImageView.image = picture.image;
      [cell TaggleBlur:YES];
  
      }
      else
      {
          [cell.pictureImageView sd_setImageWithURL: [NSURL URLWithString:picture.facebookPicture.source ]placeholderImage:[UIImage imageNamed:@"actionBar_pico_icon"]  completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
              NSArray *visibleIndexPaths = [_collectionView indexPathsForVisibleItems];
              if (error==nil) {
                  if ([visibleIndexPaths containsObject:indexPath]) {
  
                      cell.pictureImageView.image = image;
                      [cell TaggleBlur:NO];
  
                  }
              }
          }];
      }
  
      return cell;
  }
  </code></pre>