Enable setting x/y-coordinates when cropping an image

Use $cropAreaLeftRight = array( x-coordinate, width) and
$cropAreaBottomTop = array( y-coordinate, height) in resize().
Enable to create new file types

Adding function setNewFileType() for creating new file types (e.g. png
from jpeg)
Some code cleanups