Adding method to fit an image to the specified dimensions

This PR adds a method to crop and resize an image to fit the specified dimensions without stretching or squashing the image. It resizes and crops the image to fit the proportions specified exactly.

I have also added a unit test for this method as well as added PHPUnit as a dev requirement in composer.json for those who use the composer version of PHPUnit.