I went over to Windows 10 and created a CSV that was saved with Code page 1252 (Windows Western European) encoding. This had trailing CRLF line endings and when run through the above Run Shell Script, it produced the trailing ? on the renamed JPG images.
I have made a slight modification to the script to remove the carriage return part of each CSV line ending, and this will eliminate the trailing ? on the renamed images. Ideally you would save the CSV as UTF-8 text, but the fixes I have made should deal with Windows CRLF line endings.
Replace the contents of the Run Shell Script with the following updated script:
#!/bin/bash
cd "$1"
[[ -s data.csv ]] || exit 1
while IFS=$'\t,;:!' read oldfile newfile
do
[[ -f "$oldfile" ]] || continue
mv $PWD/{"$oldfile","$newfile"}
done < <(sed -e 's/"//g;' < data.csv | tr -d '\r')
/usr/bin/osascript -e 'display dialog "Processing complete."' &> /dev/null
exit 0