add resampling and image rendering