FLUID-4822: Refactor the media component to make functions public and remove repetition