So there are two ways to solve this. When the user arrives on the create page you already create a post. So you can add stuff to it. Then you can add for example a column in your database called published and you set that default to 0. When the user clicks on the create button you simply update the post with the correct field and you set the published field to 1. You can then query all published articles. You can also then once in a while or with a job delete all the unpublished posts.
The second option would be uploading the images and assigning them later on. So you save the images in the database and when the user saves the post you add the images to that post. This is much more difficult solution, because you need to keep track of the images and to which post they belong.