Replacing .embeddedMedia by .embed in the code works.
I guess this is all due to the new feature introduced with 2.3 of embedding internal links like resources and posts, everything is grouped under .embed now. With width and max-width set to 100% this is suitable for integrated resources and messages but it impacts gallery media integrations.
CSS:
.embed {
width: fit-content;
}
So this code works well for integrations from the gallery but not necessarily for resources and messages...
What to do in the meantime, if this ever needs to be fixed?