updated build_media script