use buffer directly rather than base64 encoded image.