Index: media.php
===================================================================
--- media.php	(revision 15382)
+++ media.php	(working copy)
@@ -838,8 +838,9 @@
 				margin-left: 0;
 			}
 		</style>
-		<!-- see gallery_shortcode() in wp-includes/media.php -->
-		<div id='$selector' class='gallery galleryid-{$id}'>");
+		", $selector, $float, $itemwidth );
+	$output .= "<!-- see gallery_shortcode() in wp-includes/media.php -->
+		<div id='$selector' class='gallery galleryid-{$id}'>";
 
 	$i = 0;
 	foreach ( $attachments as $id => $attachment ) {
