Fix out of memory error for bitmaps

* Augment Media.getImage to take a target height and width to sample images appropriately