Use the line below in place of set fileattach="\\networklocation\filename.jpg"
for /f "delims=" %%a in ('dir "\\networklocation\*.jpg" /b /od') do set fileattach="\\networklocation\%%a"
It selects the newest file (if there are thousands of .jpg files in the folder then expect a short delay, or ask for method B :) )
Change \\networklocation
in two places.