Follow-up 42333412833a - Fix behaviour $wgVerifyMimeType = false;

Should probably be backported to stable.

Bug: 49717
Change-Id: If1d6e8fed575bf2816a10db066ec4e023460ee1e
(cherry picked from commit 337fd7790e8d5e3a9983225c56adcd8ea8d496e7)
(cherry picked from commit dadfe0ae9349dd0bf5e1d3bedc8887289818fda1)
(cherry picked from commit adcf34af1273dd5868b21f4268d56f856b4403e5)
Merge "Follow-up 42333412833a - Fix behaviour $wgVerifyMimeType = false;" into REL1_20