resize images
for multithreads