Add #resize_to_limit
Refactor common structure of resize_to_fit and resize_to_limit
Merge pull request #4 from OIT-ADS-Web/resize_to_limit

Resize to limit