moved image generator to its own file