Build and WGL fixes.

Edit: Also contains merge of Julio's image dumping code.