image now saved
image now saves
condensed to a single loop