images: image editing: part 3 - condense some code and fix a bug in the last commit- a little to commit happy