Force index_files to Array before iteration in templates