add adaptive resize and crop method