Other causes include custom folder icons or problems creating thumbnails.  

1. Clear and Reset Your Computer’s Thumbnails Cache

Broken folder pictures usually mean the thumbnail cache is damaged. This cache saves small images for faster preview. Deleting and resetting the cache makes Windows create fresh previews, fixing any black boxes or picture problems on folder icons.

2. Disable the Read-Only Attribute for Affected Folders

Sometimes folder pictures get messed up because the system marks them as “Read-Only.” Turning off the Read-Only setting lets Windows update the folder’s icon and preview picture, which can fix the black square behind the folder icon.

FIX  Black Squares Behind Folder Icons in Windows 10 - 22