Added base64 img data javasript func