Encode arraybuffers to base64 and use drawImage