Fix empty media validation, parameterize output dir for media