changed to freeimage, and some other stuff