def images_container
      return @images_container if @images_container
      manifest = self.manifest

      @images_container = Class.new do
        extend ::CarrierWave::Mount
        include ActiveModel::Validations

        cattr_accessor :manifest, :manifest_scope
        attr_reader :content_block

        # Needed to calculate uploads URLs
        delegate :id, to: :content_block

        # Needed to customize the upload URL
        def self.name
          to_s.camelize
        end

        # Needed to customize the upload URL
        def self.to_s
          "decidim/#{manifest.name.to_s.underscore}_#{manifest_scope.to_s.underscore}_content_block"
        end

        def initialize(content_block)
          @content_block = content_block
        end

        def manifest
          self.class.manifest
        end

        manifest.images.each do |image_config|
          mount_uploader image_config[:name], image_config[:uploader].constantize
        end

        # This is used to access the upload file name from the container, given
        # an image name.
        def read_uploader(column)
          content_block.images[column.to_s]
        end

        # This is used to set the upload file name from the container, given
        # an image name.
        def write_uploader(column, value)
          content_block.images[column.to_s] = value
        end

        # When we save the content block, we force the container to save itself
        # too, so images can be processed, uploaded and stored in the DB.
        def save
          manifest.images.each do |image_config|
            send(:"write_#{image_config[:name]}_identifier")
            send(:"store_#{image_config[:name]}!")
          end
        end
      end

      @images_container.manifest = manifest
      @images_container.manifest_scope = scope
      @images_container = @images_container.new(self)
    end
def images_container
      return @images_container if @images_container
      manifest = self.manifest

      @images_container = Class.new do
        extend ::CarrierWave::Mount
        include ActiveModel::Validations

        cattr_accessor :manifest, :manifest_scope
        attr_reader :content_block

        # Needed to calculate uploads URLs
        delegate :id, to: :content_block

        # Needed to customize the upload URL
        def self.name
          to_s.camelize
        end

        # Needed to customize the upload URL
        def self.to_s
          "decidim/#{manifest.name.to_s.underscore}_#{manifest_scope.to_s.underscore}_content_block"
        end

        def initialize(content_block)
          @content_block = content_block
        end

        def manifest
          self.class.manifest
        end

        manifest.images.each do |image_config|
          mount_uploader image_config[:name], image_config[:uploader].constantize
        end

        # This is used to access the upload file name from the container, given
        # an image name.
        def read_uploader(column)
          content_block.images[column.to_s]
        end

        # This is used to set the upload file name from the container, given
        # an image name.
        def write_uploader(column, value)
          content_block.images[column.to_s] = value
        end

        # When we save the content block, we force the container to save itself
        # too, so images can be processed, uploaded and stored in the DB.
        def save
          manifest.images.each do |image_config|
            send(:"write_#{image_config[:name]}_identifier")
            send(:"store_#{image_config[:name]}!")
          end
        end
      end

      @images_container.manifest = manifest
      @images_container.manifest_scope = scope
      @images_container = @images_container.new(self)
    end
Public: Holds access to the images related to the content block. This
 method generates a dynamic class that encapsulates the uploaders for the
 content block images, and eases the access to them. It's a little bit
 hacky, but it's the only way I could come up with in order to let content
 block images have different uploaders.

 Examples:

     # This will process the image with the uploader defined at the
     # manifest, upload it and save the record.
     content_block.images_container.my_image = params[:my_image]
     content_block.save!

     # This is how you can access the image data, just like with any other
     # uploader field. You can use the uploader versions too.
     content_block.images_container.my_image.url
     content_block.images_container.my_image.big.url
     content_block.save!

     # This will delete the attached image
     content_block.images_container.my_image = nil
     content_block.save!

 Returns an object that responds to the image names defined in the content
 block manifest.