fix bug for resizing images.
Merge pull request #976 from alfredtofu/dev

fix image resizing dimensions for IO