Made Image class way more modular and object oriented

Could not test it really yet because unit tests are really almost impossible without proper dependency injection...
Tabs and spaces are mixed now.