public static void PatchItemsFile(WebGalleryBase gallery, List <DmFile> files)
        {
            string htmlFile = Path.Combine(gallery.TargetFolder, gallery.ItemsFile);

            if (!File.Exists(htmlFile))
            {
                throw new InvalidOperationException();
            }
            if (files == null || files.Count < 1)
            {
                return;
            }

            string        html      = File.ReadAllText(htmlFile);
            int           insertInd = html.IndexOf(WebGalleryBase.inputPoint);
            StringBuilder sb        = new StringBuilder(html);

            sb.Remove(insertInd, WebGalleryBase.inputPoint.Length);

            foreach (DmFile file in files)
            {
                //TO DO
                string pathFull     = gallery.ImagesFolderFullPath + file.FileName;
                string pathRelative = Path.Combine(gallery.ImagesFolder, file.FileName);
                ThumbHelper.GetThumbnailImage(file).Save(pathFull, System.Drawing.Imaging.ImageFormat.Jpeg);

                //string pathFullThumb = gallery.ThumbsFolderFullPath + file.FileName;
                //string pathRelativeThumb = Path.Combine(gallery.ThumbsFolder, file.FileName);
                //ThumbHelper.GetIconImage(file).Save(pathFullThumb, System.Drawing.Imaging.ImageFormat.Jpeg);

                pathRelative = pathRelative.Replace(@"\", "/");
                //pathRelativeThumb = pathRelativeThumb.Replace(@"\", "/");
                string newString = gallery.GenerateItemTag(pathRelative, null);
                newString += Environment.NewLine;
                sb.Insert(insertInd, newString);
                insertInd += newString.Length;
            }
            File.WriteAllText(htmlFile, sb.ToString());
        }