If a user runs the collection with --extract-media, we need to extract the media from every source and put them in a common folder. Provided each source's path in the combined document is relative to the pwd, Pandoc will reproduce the relevant folder structure in the new media bag (at least if the locations are subfolders of pwd), so this alone should prevent any filename conflict. Check that this is the case.
If a user runs the collection with --extract-media, we need to extract the media from every source and put them in a common folder. Provided each source's path in the combined document is relative to the pwd, Pandoc will reproduce the relevant folder structure in the new media bag (at least if the locations are subfolders of pwd), so this alone should prevent any filename conflict. Check that this is the case.