if (preg_match('/right/', $this->position)) {
            $x = $metadata['width'] - $this->width + $this->margin[0];
        } elseif (preg_match('/left/', $this->position)) {
            $x = 0  + $this->margin[0];
        } elseif (preg_match('/center/', $this->position)) {