CollectionInputFilter should respect the keys of collectionData

Currently the CollectionInputFilter assumes that collectionData has always consecutive array keys which can be wrong.