Added new image scale operation

Sometimes there's a need to downscale image e.g. when there is a size limit for files to be uploaded. Added new function which can be used for downscaling image to target size.

I'm not very satifisfied for this solution, because the final file size on a disk is difficult to predict, but after all this seems to downscale the image quite right based on the image resolution in the final image.