Updated version
Cleanup mixed tabs/spaces, added comments, formatting updates to improve clarity and consistency
Another stab at making GIFs resize properly with transparency (fixes #28)