fix #641 resize doesn't update image dimensions