file="$1"
name="$2"
+re_escaped_name=$(sed 's/[?+*.]/\\&/g' <<< "$name")
+
# Find next number
-max=$(ls "$destdir" | sed -rn "s/^$name ([0-9]+).jpeg$/\1/p" | sort -n | tail -n1)
+max=$(ls "$destdir" | sed -rn "s/^$re_escaped_name ([0-9]+).jpeg$/\1/p" | sort -n | tail -n1)
if [[ "$max" ]];then
number=$((max + 1))
else