add resize_pic function