resize input image if its number of cols/rows are non multiple of block_size