Remove unused dependency on Grid
Add restrict(), and make writemime use it to shrink large images

Fixes #64