Inline content with the file containing e.g. a `:` cannot be displayed
as the file name is set as the img src, and the browser treats the part
before the : as the protocol, instead of as a file name.
This change encodes the file name so `:` becomes `%3A`, fixing the
issue.
Fixes#1182.