added mediatype in MediaFile, added type validator
fixed syntax error in migrations
detail template uses MediaFile