Parse content-type and content-disposition to guess the asset type

This is an improvement over #431 since it also parses the content-type header.
Please review it. Before merging I will rebase it / or use pulley.