Hey I just found out that trim removes carriage returns too. That's cool, saved me the trouble of having to write a regular expression to kill them. I was having a problem with the random pictures having a carriage return at the end of the name. All fixed now!
Update: According to the manual page it strips white space and is considered whitespace.