I have a script that reads all images in a folder and I want to create a post for each image. I need to be able to specify the content and the category values, but I'm hoping that there's a WordPress function for this so I don't have to do it all manually. What can I do?