How to add the Gallery Item to the GalleryTool Programmatically?
There is example code snippets in the help in the GalleryItem class here.