The following would work in case it was really a space.
$ rename "s/ //g" *
Try
$ rename "s/\s+//g" *
\s is a whitespace character, belonging to the set of [ \t\r\n].
\s
[ \t\r\n]
You could do something like this:
IFS="\n"for file in *.jpg;do mv "$file" "${file//[[:space:]]}"done