Fixed bug with storing as JPG when resizing. Removed widthResize resize type and simplified so that 0 height or width fits to the other dimension.