Use get_extension() with attachment file, not original post

I tried to use this plugin but it didn't work. I noticed get_extension works against attached files, not the original post. So I write this little fix (which gets the attachment, and then apply get_extension). It seems to work now.
Merge pull request #3 from pmtarantino/patch-1

Use get_extension() with attachment file, not original post