[Bug 589465] The selected file line should be trimmed in the imagewriter