The behaviour is consistent with a leftover from the earlier OneDrive change, and the reason it appears exactly when you pin is worth explaining first.
Why pinning triggers it
The profile folder you pin is not rendered as a plain directory listing. Explorer builds it from the Known Folder registrations for the current user, then shows an entry only if the registered target path resolves. Pinning the profile folder forces that registration to be re-read. If My Pictures still points at a path that no longer exists - for example the old OneDrive\Pictures location, or a value that was only partially reverted - the entry is dropped from the view instead of showing as broken. Nothing is being deleted; the registration is failing to resolve.
Step 1 - compare the two registry values
Open regedit and check both of these, because they must agree:
-
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders- the master value, normally expandable (REG_EXPAND_SZ) -
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders- the resolved copy, rebuilt at every sign-in
Look at My Pictures in the first key. A correct value is %USERPROFILE%\Pictures. If it names a OneDrive path, an old drive letter, or a path with a typo, that is the cause.
Step 2 - repair it
Only edit User Shell Folders. Shell Folders is regenerated at logon, so hand-editing it achieves nothing.
- Set
My Picturesto%USERPROFILE%\Pictures - Keep the type as
REG_EXPAND_SZ, notREG_SZ, so the%USERPROFILE%token expands per user - Confirm the folder actually exists. If it does not, create it before signing out
Then sign out and back in rather than just restarting Explorer, so the resolved key is rebuilt.
Step 3 - if the folder exists but looks like an ordinary folder
A folder is only presented as "Pictures" when it carries its shell identity. That means a desktop.ini inside it containing a [.ShellClassInfo] section with the Pictures LocalizedResourceName and icon entries, plus the read-only and system attributes on the folder itself. Windows recreates these automatically when the folder is registered as a Known Folder and the location is changed through the UI, so prefer that route:
If Pictures is visible anywhere at all, right-click it > Properties > Location > Restore Default. That rewrites both registry keys and restores the identity in one step, and it is far safer than editing values by hand.
Two things that will undo the fix
- OneDrive's "back up your folders" feature re-registers Desktop, Documents and Pictures on every start. If OneDrive is still installed and signed in, turn that setting off before repairing, or the folder will be taken again.
- A dangling junction left over from the previous redirection can keep resolving to nothing. Check with
dir /alinC:\Users\<yourname>; an entry pointing at a removed OneDrive path should be deleted before the registry value is corrected.