In this example we have a Folder which has lead image behaviour applied to it. We want a special folderish type called category
to replace the folders in a specific location of the site.
This script is invoked with the zope controller for your Zope/Plone site.
bin/instance -OPlone run {scriptname}
or in your site is not at the root of your Zope application server then the full path to the site
bin/instance -O'full/path/to/plone' run {scriptname}
This is also a simple example of setting image-like content when dealing with a lead image.
Read through this code if you want to know more about dealing with images and Plone https://gist.github.com/pigeonflight/2f2fb187f2681bed90cf0c1baffe09d4