Refactor MediafileBehavior and remove `id` from mediafiles table