Your problem is related to Delayed Expansion. Solve it this way:
setlocal EnableDelayedExpansion
for /r "Pictures" %%a in (*) do (
set var=%%a
echo !var:\=\\! >> pic.txt
)
For further explanation, google for "delayed expansion" and/or read the section about it in set /?
command.