Fix 'maintainAspectRatio' for GD. #662
Explicitly destroy GD images.
Scale up images in GD.

ImageMagick will scale up images if they're smaller than the requested
width/height, so do the same in ImageGD. Fixes some minor problems in
the gallery view.
Merge pull request #1022 from danieljames/gd-fixes

Gd fixes