 improvement of the jpeg detection

 the check, if the target image will be a jpeg,
 now based on the ImageCropScaleMaskTask.
 will allow other extension to change what the
 extension is without unexpected behavior from this
 here.