Refactor find featured media code