Added dynamic resizing of images