Hi Jelle,
Kentico 12 Service Pack brought media selection inline editor, please check out the documentation.
Also, you can check my article about writing custom media picker and using it in a custom widget. And here is the code example from the article. I hope it will help.