added a totalCostLimit to the image cache