add upload local image function.