Index: src/wp-content/themes/twentyeleven/content-gallery.php
===================================================================
--- src/wp-content/themes/twentyeleven/content-gallery.php	(revision 31362)
+++ src/wp-content/themes/twentyeleven/content-gallery.php	(working copy)
@@ -36,7 +36,7 @@
 				$images = twentyeleven_get_gallery_images();
 				if ( $images ) :
 					$total_images = count( $images );
-					$image = array_shift( $images );
+					$image = current( $images );
 			?>
 				<figure class="gallery-thumb">
 					<a href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
Index: src/wp-content/themes/twentyfourteen/functions.php
===================================================================
--- src/wp-content/themes/twentyfourteen/functions.php	(revision 31362)
+++ src/wp-content/themes/twentyfourteen/functions.php	(working copy)
@@ -330,7 +330,7 @@
 
 		// or get the URL of the first image attachment.
 		else {
-			$next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
+			$next_attachment_url = get_attachment_link( current( $attachment_ids ) );
 		}
 	}
 
Index: src/wp-content/themes/twentyfourteen/inc/widgets.php
===================================================================
--- src/wp-content/themes/twentyfourteen/inc/widgets.php	(revision 31362)
+++ src/wp-content/themes/twentyfourteen/inc/widgets.php	(working copy)
@@ -149,7 +149,7 @@
 									if ( has_post_thumbnail() ) :
 										$post_thumbnail = get_the_post_thumbnail();
 									elseif ( $total_images > 0 ) :
-										$image          = array_shift( $images );
+										$image          = current( $images );
 										$post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' );
 									endif;
 
Index: src/wp-content/themes/twentyten/loop.php
===================================================================
--- src/wp-content/themes/twentyten/loop.php	(revision 31362)
+++ src/wp-content/themes/twentyten/loop.php	(working copy)
@@ -75,7 +75,7 @@
 					$images = twentyten_get_gallery_images();
 					if ( $images ) :
 						$total_images = count( $images );
-						$image = array_shift( $images );
+						$image = current( $images );
 				?>
 						<div class="gallery-thumb">
 							<a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo wp_get_attachment_image( $image, 'thumbnail' ); ?></a>
Index: src/wp-content/themes/twentythirteen/functions.php
===================================================================
--- src/wp-content/themes/twentythirteen/functions.php	(revision 31362)
+++ src/wp-content/themes/twentythirteen/functions.php	(working copy)
@@ -431,7 +431,7 @@
 
 		// or get the URL of the first image attachment.
 		else
-			$next_attachment_url = get_attachment_link( array_shift( $attachment_ids ) );
+			$next_attachment_url = get_attachment_link( current( $attachment_ids ) );
 	}
 
 	printf( '<a href="%1$s" title="%2$s" rel="attachment">%3$s</a>',
