public ActionResult CreateImage(ConfigurationGalleryImagesModel model)
        {
            if (ModelState.IsValid)
            {
                //var gallery = model.ToEntity();
                var gallery = new GalleryImages
                {
                    Name         = model.Name,
                    Description  = model.Description,
                    DisplayOrder = model.DisplayOrder,
                    PictureId    = model.PictureId,
                    UpdatedOnUtc = DateTime.UtcNow,
                    CreatedOnUtc = DateTime.UtcNow,
                };

                if (model.SelectedOptions != null)
                {
                    foreach (var option in model.SelectedOptions)
                    {
                        var gal = _galleryService.GetGalleryById(int.Parse(option));

                        if (gallery.Galleries.Count(g => g.Id == gallery.Id) == 0)
                        {
                            gallery.Galleries.Add(gal);
                        }
                    }
                }
                _galleryService.InsertGalleryImage(gallery);

                //locales
                UpdateImageLocales(gallery, model);
                //update picture seo file name
                UpdateImagePictureSeoNames(gallery);

                SuccessNotification(_localizationService.GetResource("Plugin.Widgets.Gallery.GalleryConfigureController.ImageAdded"));
            }
            var galleries = _galleryService.GetAllGalleries();

            foreach (var gallery in galleries)
            {
                model.ListGalleries.Add(new SelectListItem {
                    Text = gallery.Name, Value = gallery.Id.ToString(CultureInfo.InvariantCulture)
                });
            }

            return(View("~/Plugins/Widgets.Gallery/Views/GalleryConfigure/CreateImage.cshtml", model));
        }