How to restrict image size globally

I’m trying to apply a global CSS stylesheet on my chat-app. The problem is, that my chatbot returns HTML that contains sometimes really huge images that break the whole layout. Therefore I would like to restrict the maximum size of all img items. I don’t really understand this syntax with host and local. My current approach was:


stylesheet = """
:global img {max-width: 400px;  max-height: 400px}
"""

pn.extension("perspective", 
             sizing_mode="stretch_width", 
             notifications=True,
             global_css=[stylesheet])

but this does not work. Maybe someone can help me find my mistake.