Trim and escape filename