added factory class to instantiate a Post's media object