public function removeFrame($index)
    {
        if (!isset($this->frames[$index])) {
            throw new InvalidArgumentException('Invalid frame index to remove.');
        }

        array_splice($this->frames, $index, 1);
    }