replace images with base64