Updating images will increase memory usage
### Checklist

- [X] I have searched the [existing issues](https://github.com/streamlit/streamlit/issues) for similar issues.
- [X] I added a very descriptive title to this issue.
- [X] I have provided sufficient information below to help reproduce this issue.

### Summary

When updating images frequently the memory usage of the Streamlit app keeps increasing. A lot!

You don't need a lot of sessions to get this behavior. Running a single page and refreshing it after some time will not release the memory.

### Reproducible Code Example

```Python
import datetime
import time
import psutil
import os
pid = os.getpid()


import cv2
import numpy as np
import streamlit as st

img = np.random.rand(600,600,3)

@st.cache_resource(ttl=1)
def get_memory(pid):
    process = psutil.Process(pid)

    # Get the memory usage in RAM
    memory_usage = process.memory_info().rss

    # Convert the memory usage to MB
    memory_usage_mb = memory_usage / (1024 * 1024)
    return(memory_usage_mb)
    #print(f"Total memory usage of all running Python processes: {mem_usage} bytes")


def get_image():
    # Get current date and time
    img_with_date = img.copy()
    now = datetime.datetime.now()
    dt_string = now.strftime("%d/%m/%Y %H:%M:%S.%f")[:-3]
    cv2.putText(img_with_date, dt_string, (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 0), 2)
    return img_with_date

def app():
    if "page_open" not in st.session_state:
        st.session_state.page_open = True

    if "num_img" not in st.session_state:
        st.session_state.num_img = 0


    st.title("Test memory usage of st.image...")

    text_placeholder = st.empty()
    img_placeholder = st.empty()

    while "page_open" in st.session_state:
        text_placeholder.write(f"{st.session_state.num_img} {get_memory(pid):.2f}MB")
        img_placeholder.image(get_image())

        st.session_state.num_img += 1
        time.sleep(1/10)

    print("Session ended...")
    img_placeholder.empty()
    text_placeholder.empty()
    st.stop()
if __name__ == "__main__":
    app()
```


### Steps To Reproduce

1. Run streamlit app
2. Maybe open a few tabs to speed up the memory consumption
3. Close all tabs
4. Open a new tab, memory usage will have decreased a bit but it will never go down to an acceptable size anymore

### Expected Behavior

Resources should be removed when no sessions are running anymore. In specific use cases it might even be needed to have an aggressive cleanup of resources, for example when showing live video.

### Current Behavior

Current behavior is that images are stored somewhere in RAM and there doesn't seem to be a way to control it. This was already discussed [on the forum](https://discuss.streamlit.io/t/updating-images-in-a-while-loop-keeps-increasing-ram-even-after-sessions-are-closed-and-cleaned-up/38226/5) with @vdonato



### Is this a regression?

- [ ] Yes, this used to work in a previous version.

### Debug info

Streamlit version: 1.20.0
Python version: 3.10.9
Operating System: Windows 11 (WSL2)
Browser: Chrome
Virtual environment: conda

### Additional Information

The app will show both the image id and the memory usage to make it really easy to see that the RAM is indeed increasing over time.

Dependencies:
```
pip install streamlit==1.20.0
pip install opencv-python-headless
pip install psutil
```

### Are you willing to submit a PR?

- [ ] Yes, I am willing to submit a PR!