media: fix for generating preview filenames if the inserted id is 'insert_rsc'

(cherry picked from commit 660e77b09e82fda489e8640992f4a95e07c22dc0)