My theory that not all GID numbers on my SD were correct is proved. I my particular case at least. As I was using the SD from phone with previous release(s) some GID numbers were old. Obsoleted by nemo->defaultuser transition I guess. Maybe even my fault when restoring from backup.
With these commands and reboot most of my contact pictures are back. No idea why not all:
devel-su # to get root
ls -laR /run/media/defaultuser/854788d8-1c33-4193-9cdc-e8a0364c55af/ # to see current state
find /run/media/defaultuser/854788d8-1c33-4193-9cdc-e8a0364c55af/Pictures/ -type d -exec chown defaultuser:privileged {} \; recursive change UID and GID of Pictures directory and subdirectory
find /run/media/defaultuser/854788d8-1c33-4193-9cdc-e8a0364c55af/Pictures/ -type f -exec chown defaultuser:defaultuser {} \; recursive change UID and GID of all files in Pictures directory
find /run/media/defaultuser/854788d8-1c33-4193-9cdc-e8a0364c55af/Videos/ -type d -exec chown defaultuser:privileged {} \;
find /run/media/defaultuser/854788d8-1c33-4193-9cdc-e8a0364c55af/Videos/ -type f -exec chown defaultuser:defaultuser {} \;
That’s what I did. But full chown is a bit overkill I guess. So:
After proper backup of SD card I recommend to try this workaround for getting the contact pictures back:
You need to change 854788d8-1c33-4193-9cdc-e8a0364c55af to UUID of your SD of course!
devel-su
# list pictures with wrong group ID
find /home/defaultuser/Pictures/ -type f \! -group defaultuser -print # or nemo instead of defaultuser.
find /run/media/defaultuser/your_SD_UUID/Pictures/ -type f \! -group defaultuser -print # or nemo instead of defaultuser.
find /run/media/defaultuser/your_SD_UUID/Pictures/ -type d \! -group privileged -print # or nemo instead of defaultuser.
# or if you want to list all Pictures:
ls -laR /run/media/defaultuser/your_SD_UUID/Pictures/
# change
find /run/media/defaultuser/your_SD_UUID/Pictures/ -type f -exec chgrp defaultuser {} \;
find /run/media/defaultuser/your_SD_UUID/Pictures/ -type d -exec chgrp privileged {} \;
# repeat in /home/defaultuser/Pictures/
# you might want to check Videos directory and repeat it there too.
# and also in home directory
And please report the results.
EDIT: Added recursivity to ls and also better find of files and directories with wrong GID