store images in json documents using base64 encoding