Add mipmap generation
Merge pull request #264 from cmr/master

Add mipmap generation