Filenames are not a good IRI see https://phabricator.wikimedia.org/T277665#6931281
There is also possibly encoding issues
@Multichill proposed to use MID instead of filenames here: https://phabricator.wikimedia.org/T258776#6874936
What do we need to make this a reality? A new datatype?