work on images, simplifying; work for #518