get_media_path: add fallback to allow using Galleries with standalone placeholder fields outside of Pages.

Code from CMSPluginbase