Fix writeImage realpath issues on PHP 5.4 w/ Imagick