better handling of images