media library: fix path history for items with a real path differing from the requested path
Merge pull request #5941 from Montellese/fix_media_history

media library: fix path history for items with a real path differing from the requested path