Minor fixes and add auto resize for images