Update writeImages.php