Found out what it was by process of elimination. Disabled all my plugins, then moved on to using a different theme.
It worked fine with a different theme – so I took a look at the functions.php of my theme.
Turned out I ended the file with “?>”
Everything had worked fine except for the media selection. So I deleted those two characters and now everything works like a charm.