Description: We've inherited a codebase responsible for handling image caching, swapping images in and out, managing their lifecycle via strings, and swapping them into and out of documents. However, it's abundantly clear that this code is in a state of disrepair. To kickstart the process of addressing these issues, we're initiating a tracker bug to systematically gather and document the numerous problems plaguing this system. Steps to Reproduce: 1. Open LibreOffice 2. Paste an Webp file 3. LibreOffice Crashes Actual Results: Crashes Expected Results: Working properly Reproducible: Always User Profile Reset: No Additional Info: Nothing more