Adds handling for gif and png images when uploading to the WP media library. Fixes #548 and #84.