Replace images with base64 strings