moved image stuff to its own class, cleaned it up