added scaling down of image before putting bitmap into cache