lightmaps: Fixed image loading bug in OS X + refactoring (see below).

OS X has an image loading bug where it changes the direction of the
camera when you load an arbitrary amount of images. I've noticed
that it has something to do with GLFWwindow being changed at some
point, but I have no power over that.

By some odd reason, the fix for this was to create only one
instance of an image class from FreeImage and use that as container
to load all the images, which we then convert to textures.
lightcaster: Ported work from lightmaps.