diff --git a/src/matrixeventprocessor.ts b/src/matrixeventprocessor.ts
index f0dd98446e2a7a5133ff62ba189a9dfe85664dbc..c546f98459c062e2024898443ce8a750806e6acc 100644
--- a/src/matrixeventprocessor.ts
+++ b/src/matrixeventprocessor.ts
@@ -523,7 +523,7 @@ export class MatrixEventProcessor {
 
         if (profile?.avatar_url) {
             const attachment = await this.bridge.botClient.downloadContent(profile.avatar_url);
-            const base64 = `data:${attachment.contentType}attachment.data.toString('base64')`;
+            const base64 = `data:${attachment.contentType};base64,${attachment.data.toString('base64')}`;
             avatarUrl = base64;
         }