added auto resizing of images