Reduce memory usage when generating thumbnails

Closes #1.

Large GIFs cause convert to use up more memory than is available, causing the process to get killed and image upload to ultimately fail. Well spotted @mmolina.