add files list into page in a new way using x-tmpl
simplify the image gallery function