Maybe that will help someone who sets the desktop picture from Safari, but I have never used that feature in Safari.
I simply click on that option by right-clicking the image file, and choosing to set the image from there. Safari is not involved at all.
The Set process does "something", the background image changes to that image.
I just can't discover what file/plist actually changes to register that new image (and where that background image gets stored?
That command takes me to the file that YOU referred to, and ~/Library/Preferences/com.apple.desktop shows some previous desktop picture selections, but that file has not been updated for more than 4 years, and doesn't show ANY images since probably an upgrade to Yosemite, and I choose some other image (sometimes system-provided, sometimes nice images that I like from somewhere else) And, I would see recognizable file names, as some are personal pictures over the last 3 or 4 years. NONE of those show up, and certainly not the recent picture that I just changed to, not more than an hour ago - a picture that I have never used before. I deleted the picture file after changing the desktop, restarted, and the background picture remains as I set it. Just the image itself is nowhere to be found.
Must be in a cache somewhere, but I can't find it - at least not by the filename of the original file.
And, of course, if I change the desktop NOW, and don't still have that picture stored somewhere, there's no way back (other than the usual Time Machine, or other backup process)
Here are some Terminal cmd-lines that may help figure out the pathname of the actual background image.
First, we get a list of every possible 'defaults' setting. This will probably be a file with several thousand lines it. Don't worry, you won't have to open it.
Next, go change your desktop picture using right-click.
Here, we get the same list of every possible 'defaults' setting, but it's output to a different file.
Finally, we get a list of only the differences between the 2 files, in "diffs.txt" in your home folder.
Code:
diff ~/before ~/after >~/diffs.txt
At this point, it should be safe to open diffs.txt in a text editor, since it probably won't have 1000's of lines.
If you're unsure what might be in it, paste this into a Terminal window before opening the file.
The number is the count of lines in the file.
If it's in the thousands, or even hundreds, then that seems to me to be an unexpectedly large number of differences, and it's likely the whole strategy of "find differences of before and after" is flawed. If it's several dozen lines, or even under a dozen, then it's probably a list that contains the pathname of the desktop picture after using right-click to set it. You can post the output here, or just post what you discover about where the file is located.
If there are 0 lines in diffs.txt, then try regenerating the "after" file after waiting several minutes after setting the desktop picture with right-click. The defaults system might take some time to update. Or it could be that setting the desktop picture with right-click is no longer being stored in the defaults system.
You can delete the "before" and "after" files in your home folder without bothering to open them. If you're curious how long they are:
The output is the number of lines in "after".