See line 15 of this diff, where a lot of code starting with data:image/jpeg;base64,/... was added.
I inquired about this briefly in the IRC channel and Krenair provided the following evaluation:
16:16 <•Krenair> yeah so the gallery which has the filenames works, the gallery which tries to directly embed the image does not
16:17 <Elitre> so all that data:image/jpeg;base64,/etc etc mess, how did it end up there?
16:18 <•Krenair> I wonder if that's what happens in some browsers when the user tries to drag an image in directly
16:19 <•Krenair> ultimately the contents of that gallery tag is directly user-controlled
16:19 <•Krenair> so I think valid answers may include 'the user typed it in' or 'the user pasted it in'