See the documentation for this constructor. Specifically the section that reads:
The file remains locked until the Bitmap is disposed.
You must dispose the sourceImage
before saving a new one. So, use different variables:
var sourceImage = new Bitmap("images/sourceImage.jpg");
var croppedImage = CropBitmap(sourceImage, 0, 0, sourceImage.Width, 50);
sourceImage.Dispose();
croppedImage.Save("images/sourceImage.jpg", ImageFormat.Jpeg);
croppedImage.Dispose();