imagewriter.php now even simpler!