fix image resize method

error in final commit.