Fixing the iteration over the collection of images and initialization of the DataProvider.