Fixed typo in gradient formula
Image scaling to save() + unittests, image adjustment call to save()
Removed _calculate_mean(), use image scaling instead in image.save()