trim image spaces