refactoring class helper into a global helper
adding templates for photos and videos