diff --git a/lib/transforms/moveAssets.js b/lib/transforms/moveAssets.js
index <HASH>..<HASH> 100644
--- a/lib/transforms/moveAssets.js
+++ b/lib/transforms/moveAssets.js
@@ -6,7 +6,15 @@ var URL = require('url'),
 exports.moveAssets = function (query, newUrlFunction) {
     return function moveAssets(assetGraph, cb) {
         assetGraph.findAssets(query).forEach(function (asset) {
-            assetGraph.setAssetUrl(asset, newUrlFunction(asset, assetGraph));
+            var newUrl = newUrlFunction(asset, assetGraph);
+            // Keep the existing file name if the new url ends in a slash:
+            if (asset.url && /\/$/.test(newUrl)) {
+                var matchFileName = asset.url.match(/\/([^\/]+)(?=\?|$)/);
+                if (matchFileName) {
+                    newUrl += matchFileName[1];
+                }
+            }
+            assetGraph.setAssetUrl(asset, newUrl);
         });
         process.nextTick(cb);
     };
transforms.moveAssets: Keep the existing file name if the new url ends in a slash.