Creating a template filter to extract the first media object