Resizes preserving aspect ratio to fit inside size x size, centring it on a canvas filled with padValue.
size x size