Added functions for programmatic creation of gallery posts.