Generate thumbnails in main thread, and remove popup

Ok, so this is not to be merged yet, because it's ugly as hell, but let me know if it works for you @ocommowi .

You might need to disable the trick to have no popup on mac (the #ifdef), it works on Linux, but it's such a ugly hack that it might destroy all life as we know it on Mac.