public function listImages($nodeImageId = null) { if ($nodeImageId) { return $this->toImage($this->digitalocean->image()->getById($nodeImageId)); } return array_map([$this, 'toImage'], $this->digitalocean->image()->getAll()); }