Better filetype detection

This takes a smarter approach to determining the file type so we don't barf all over the place when dealing with data that should be sent to shopify as binary data.

This fixes #85 

Please review @maartenvg 

/cc @jduff @tylerball