... although one must ask why the "items" loop above doesn't get caught in an infinite loop: we add to the mediabag, and the iteration should get to new items eventually, and so on, no?
Didn't happen in my limited tests, but could, so above code suspicious, unless we can know if iterator only iterates on original list of items.