complete rewrite of image subsystem, started working on GUI again