Remove full screen icon for various elements

Is there a way to remove the fullscreen icon/action, specifically from images and bokeh plots? I asked about it here, though that may have not been the appropriate place to do so.

For context, I have a logo/icon for my app and it does not make sense to allow users to make this larger. I am also displaying a Bokeh plot that distorts improperly when made full size (due to issues within that library).

It would be really great to simply hide this option from the user, but I haven’t been able to find or devise a solution

For the logo/icon question, I think it if you specified the st.image call as st.markdown with image HTML, it probably wouldn’t have the expander. It’s something for us to consider though, there should at least be the option to turn it off.

Unsure about Bokeh…in the link to the other question, it looks like it might be disabled with CSS, but that’s a pretty fickle solution.

I was able to mostly solve both of these issues by writing some CSS:

hide_full_screen = '''
<style>
.element-container:nth-child(3) .overlayBtn {visibility: hidden;}
.element-container:nth-child(12) .overlayBtn {visibility: hidden;}
</style>
'''

st.markdown(hide_full_screen, unsafe_allow_html=True) 

I dont know html/CSS so I dont totally understand what I did here, and accessing the elements via nth-child is sub-optimal since if different input options are selected, the element-containers have different “n” values. Is there a less hard-coded solution to access these elements?