auto resize image method added