Fix windows compilation
Fix some build system issues
Fix segfault on missing image file
Fix file loading code + demo, runs in WINE