public ActionResult DeleteProductPicture(int id)
        {
            if (!_permissionService.Authorize("ManageProducts"))
            {
                return(AccessDeniedView());
            }

            if (id == 0)
            {
                throw new Exception("Picture id not found");
            }

            var pictureRecord = _pictureService.GetProductPictureByPictureId(id);

            if (pictureRecord != null)
            {
                _pictureService.DeleteProductPicture(pictureRecord.Id);
            }
            else
            {
                var picture = _pictureService.GetPictureById(id);
                if (picture != null)
                {
                    _pictureService.Delete(picture.Id);
                }
            }

            SuccessNotification("Product picture deleted successfully");
            return(new JsonResult()
            {
                Data = true,
                ContentEncoding = Encoding.Default,
                ContentType = "application/json",
                JsonRequestBehavior = JsonRequestBehavior.AllowGet,
                MaxJsonLength = int.MaxValue
            });
        }