add base64 decode to save image