media: user more random filenames for previews.
Prevents race conditions between file updates, as was with the old scheme based on a content hash.

(cherry picked from commit 9038bdacea50dff2f1482f441e658afdc85405bf)