Code:  Refactoring and minor fixes

Maximum dimensions allowed by http://placehold.it is 5479x2920, so we will round off, if user dimensions exceed those. In case of http://lorempixel.com/, the max limit is 1920x1920.