Fix writeImage realpath issues on PHP 5.4 w/ Imagick

Conflicts:
	im_render_statscard.php
Actually finished merging that charry-pick.