Fixed hanging publish issue by making sure images directories existed