I think the issue here is that git doesn't track empty directories, they need to contain at least one file for git to "see" them, so although your media directory exists locally it doesn't exist on Heroku. A common way of handling this is to create an empty file called .keep in the directory.