add GM to resize images.
fix bugs.