Add resize image function