fixed tests and implementation of media attachments for posts

fixes #36