Creates a new image copy that is of a desired size. The aspect ratio will be kept constant if 'keepAspectRatio' is true, by cropping undesired parts so that only pixels of the original image are shown, instead of adding extra blank space. Remember to free the new image later.