Basic preprocessing function: resize.