media gen dir is optional, first check if it exists