Fix the logic of convert attachment's object.
Eliminated old template.