messy rewrite to be able to output progress, directly write to image for speed reasons
removed unused struct
added progressbar