fix unit tests
fix npe, update resize image