Index: trunk/lib/MT/Asset/Image.pm
===================================================================
--- trunk/lib/MT/Asset/Image.pm (revision 2635)
+++ trunk/lib/MT/Asset/Image.pm (revision 3082)
@@ -231,5 +231,5 @@
 
     require MT::Util;
-    my $format = $param{Format} || MT->translate('%f-thumb-%wx%h%x');
+    my $format = $param{Format} || MT->translate('%f-thumb-%wx%h-%i%x');
     my $width  = $param{Width}  || 'auto';
     my $height = $param{Height} || 'auto';
@@ -550,4 +550,5 @@
                     $app->translate( "Invalid basename '[_1]'", $rel_path ) );
             }
+            $rel_path .= '-' . $asset->id;
             my $ext = $blog->file_extension || '';
             $ext = '.' . $ext if $ext ne '';
@@ -567,13 +568,5 @@
               File::Spec->catfile( $root_path, $rel_path . $ext );
 
-            ## If the popup filename already exists, we don't want to overwrite
-            ## it, because it could contain valuable data; so we'll just make
-            ## sure to generate the name uniquely.
             my ( $i, $rel_path_ext ) = ( 0, $rel_path . $ext );
-            while ( $fmgr->exists($abs_file_path) ) {
-                $rel_path_ext = $rel_path . ++$i . $ext;
-                $abs_file_path =
-                  File::Spec->catfile( $root_path, $rel_path_ext );
-            }
             $pseudo_path = File::Spec->catfile( $pseudo_path, $rel_path_ext );
             my ( $vol, $dirs, $basename ) =
@@ -600,5 +593,7 @@
                 $original   = $asset_html->clone;
                 $asset_html->blog_id($blog_id);
-                $asset_html->url($pseudo_path);
+                my $pseudo_url = $pseudo_path;
+                $pseudo_url  =~ s!\\!/!g;
+                $asset_html->url($pseudo_url);
                 $asset_html->label($app->translate("Popup Page for [_1]", $asset->label || $asset->file_name));
                 $asset_html->file_path($pseudo_path);
@@ -610,5 +605,5 @@
             } else {
                 $original   = $asset_html->clone;
-            }                
+            }
 
             # Select back the real URL for callbacks
