As far as I understand, this happens because the gallery macro implementation relies on hard-coded colors. It should use colors from the color theme instead.
I'll start a brainstorming before trying to implement the white background. This is a big visual change and could be seen as a regression by some users (e.g. it makes it harder to distinguish the macro from surrounding context), I'd like to confirm that we want it with the community before going forth with it.
Thanks for the report Lucas C.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.