This is happening because say your page size is 3, but with 4 elements you are showing 2/3 of the first page and 1/3 of a expected 2nd page. When you tap in the cell the collection move to show completely the page that has more content shown to the user at that moment.
You can check this if for example you use 7 elements and press on the 7th the collection go to the 4th.
The way to avoid this behaviour would be to have have always "complete pages" so if you don't have enough elements to fill the page you need to tell the content view to be bigger anyway. So you need to subclass UICOllectionViewFlowLayout with something similar to this:
- (CGSize)collectionViewContentSize {
CGSize contentSize = [super collectionViewContentSize];
// This assume you have a public method in your collection view controller to calculate the number of pages for any given number of elements
NSInteger pages = [(YourCollectionViewController *) self.collectionView.delegate pagesNumber];
// then you return the size for n times the number of pages in width and one time for height
return CGSizeMake(CGRectGetWidth(self.collectionView.frame) * pages, contentSize.height);
}