refactored Post model to remove duplication between link & image validation