Clicking OK to remove Thumbnails in Disk Cleanup clears the thumbnail cache, not the original files.
The thumbnail cache is a Windows cache used to store preview images. Windows uses that cache to show thumbnails in File Explorer. Clearing it removes those cached previews so Windows can rebuild them. It does not delete the actual photos, folders, or other original files.
If the issue is black squares behind folders, clearing Thumbnails is a reasonable troubleshooting step. After cleanup, File Explorer may temporarily show generic icons or blank previews until Windows recreates the thumbnails.