Fix possible crash when reloading the collection view with different number of items