Modified is_media function to return media type