DIVIDE DIFFERENT IMAGES SIZE IN TO BLOCKS 128X128

MY case is I have database contain more images but with different size. So I want divide each image into blocks with 128 x128 .pls how can do that?