resize and crop snippet