#640318 trimage: should remember attributes of original files