added image resizing functionality