Refactor: Moved image file interpretation to resource/image.cpp

Plus some minor cleanup.