Added feather parameter to trim()
Respect maximum dimensions of image

Moved feathering from the 'applying' part to the 'detection' part
added unit tests for trim with feathering