protected function buildImage($actions, Image $image, $dst)
    {
        foreach ($actions as $action) {
            // Make sure the width and height are computed first so they can be used
            // in relative x/yoffsets like 'center' or 'bottom'.
            if (isset($action['width'])) {
                $action['width'] = $this->percent($action['width'], $image->getWidth());
            }

            if (isset($action['height'])) {
                $action['height'] = $this->percent($action['height'], $image->getHeight());
            }

            if (isset($action['xoffset'])) {
                $action['xoffset'] = $this->keywords($action['xoffset'], $image->getWidth(), $action['width']);
            }

            if (isset($action['yoffset'])) {
                $action['yoffset'] = $this->keywords($action['yoffset'], $image->getHeight(), $action['height']);
            }

            $this->getMethodCaller()->call($image, $action['action'], $action);
        }

        return $image->save($dst);
    }