Added support for images more than 2048x2048 in size.