infrastructure for inline media

issue #1915