Where does OS X store your current desktop picture?
In current versions of macOS (at least in Mojave, probably since Sierra, not sure about others) the location of the desktop pictures are stored in a SQLite database located at ~/Library/Application Support/Dock/desktoppicture.db.

I did not dig into details of the database structure but you can get the file path with this command:

sqlite3 -readonly ~/Library/Application\ Support/Dock/desktoppicture.db \
    'SELECT * FROM data ORDER BY rowID DESC LIMIT 1;'