remove beginning and ending white space from image names