Added utils methods for handling scaling of bitmaps