title: Wagtail: Inserting links to images in rich text field
body: <p>I have a need to insert links to images held in the CMS in rich text editor, similar to how documents are inserted. However, by default images are inserted as embeds and requires an extra step to choose a format. How I could override the &quot;insert image&quot; button in rich text editor to work similar to documents and insert images only as a link?</p>
  <p>In other words, the current document chooser provides the following database entry:</p>
  <p><code>&quot;value&quot;: &quot;&lt;p&gt;&lt;a id=\&quot;1\&quot; linktype=\&quot;document\&quot;&gt;Download pdf&lt;/a&gt;&lt;/p&gt;&quot;</code></p>
  <p>I would like to have something similar to images as well, for example:</p>
  <p><code>&quot;value&quot;: &quot;&lt;p&gt;&lt;a id=\&quot;1\&quot; linktype=\&quot;image\&quot;&gt;Download image&lt;/a&gt;&lt;/p&gt;&quot;</code></p>
  <p>Technically I don't care about the database representation so I'm also okay with a solution which only changes the API output to similar format as documents have, for example:</p>
  <p><code>&lt;p&gt;&lt;a href=\&quot;/documents/1/document.pdf\&quot;&gt;Download pdf&lt;/a&gt;&lt;/p&gt;</code></p>
  <p>However, I still would like to get rid of the unnecessary step in CMS to choose image format.</p>
  <p>Any suggestions?</p>