More heap thrashing fixes.
add support for centerCrop and centerInside