fix #641 resize doesn't update image dimensions
Merge branch '2.x' into 2.x_n