shan jiejing: add save image function.