function getFilteredMedia(array $filters, $allowPlaceholder = true)
    {
        $col = [];
        foreach($this['media'] as $medium) {
            if (!isset($hasImage) && $medium['type'] == 'image') {
                $hasImage = true;
            }
            if (in_array($medium['type'], $filters)) {
                $col[] = $medium;
            }
        }

        // Add a placeholder if the image type was requested, and no images were found.
        if (in_array('image', $filters)
            && !isset($hasImage)
            && $allowPlaceholder
            && $this->getPlaceholder()) {
            $col[] = $this->getPlaceholder();
        }

        return $col;
    }