Rewrite multiple file upload; add Post.type to indicate type of a post