Java code to resize images in batches.