private function getLastMediaCollection() { if (!$this->lastCollection) { throw new \InvalidArgumentException('No media collection has previously been created in this session, cannot use getLastMediaCollection'); } return $this->lastCollection; }