replanImage function