able to resize the uploaded image when its size is larger than assigned(fixes #3561)

able to resize the uploaded image when its size is larger than assigned(fixes #3561)