diff --git a/endpoints/registry.py b/endpoints/registry.py
index c2eb5334d..626dd171d 100644
--- a/endpoints/registry.py
+++ b/endpoints/registry.py
@@ -125,9 +125,12 @@ def put_image_layer(namespace, repository, image_id):
   sr.add_handler(sum_hndlr)
   store.stream_write(layer_path, sr)
   csums.append('sha256:{0}'.format(h.hexdigest()))
-  image_size = None
   try:
     image_size = tmp.tell()
+
+    # Save the size of the image.
+    model.set_image_size(image_id, namespace, repository, image_size)
+
     tmp.seek(0)
     csums.append(checksums.compute_tarsum(tmp, json_data))
     tmp.close()
@@ -150,10 +153,6 @@ def put_image_layer(namespace, repository, image_id):
   # Checksum is ok, we remove the marker
   store.remove(mark_path)
 
-  # Save the size of the image if we know it.
-  if image_size is not None:
-    model.set_image_size(image_id, namespace, repository, image_size)
-
   # The layer is ready for download, send a job to the work queue to
   # process it.
   logger.debug('Queing diffs job for image: %s' % image_id)
diff --git a/static/js/app.js b/static/js/app.js
index 990825c70..4d0637924 100644
--- a/static/js/app.js
+++ b/static/js/app.js
@@ -1027,7 +1027,7 @@ quayApp.directive('dockerAuthDialog', function () {
 
 quayApp.filter('bytes', function() {
   return function(bytes, precision) {
-    if (!bytes || isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '';
+    if (!bytes || isNaN(parseFloat(bytes)) || !isFinite(bytes)) return 'Unknown';
     if (typeof precision === 'undefined') precision = 1;
     var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
     number = Math.floor(Math.log(bytes) / Math.log(1024));