fix server compile warnings, and move gif generator to separate file to make core easier to read