inventorycube: Use direct image access using lock()