added image auto resizing