A bit of refactoring around unique naming, and implementing it for media as well
Add missing id to unique naming overload
Fixes #U4-2450