How to convert cloud image to base64

Currently, I bind cloud image to page var and convert to cache file.

Then I convert the cache path file to base64 and send to Google. However the image does not display.

I tried to hard code the base64 file inside Appgyver (second declaration of page var logobase64 in the picture attached) and send to Google. The image displayed.

What are the step that I missing? I saw the convert file to base64 need to use local URL. But I used cache path. Is it correct?