       uploadProgress: () ->
          percent = Session.get "#{this._id}"
 
-      isImage: () ->
-         imageTypes[this.contentType]?
+      isImage: isImage
 
       altMessage: () ->
          if this.length isnt 0
             "Processing thumbnail of #{shorten this.filename, 20}..."
          else
             "Uploading #{shorten this.filename, 20}..."
+
+   Template.fileTable.helpers fileTableHelpers
 
    fileTableEvents =
       # Wire up the event to remove a file by clicking the `X`
       'click .del-file': (e, t) ->
          t.data.remove this._id
 
-   Template.gallery.helpers fileTableHelpers
+   Template.fileTable.events fileTableEvents
 
    Template.gallery.helpers
       dataEntries: () ->

      else
         name

   Template.top.helpers
      loginToken: () ->
         Meteor.userId()

         return "active" if pill is "#{this}"

   fileTableHelpers =
      dataEntries: () ->
         # Reactively populate the table
         this.find({}, {sort:{filename: 1}})

      owner: () ->
         this.metadata?._auth?.owner

      id: () ->
         "#{this._id}"

      shortFilename: shortFilename

      uploadStatus: () ->
         percent = Session.get "#{this._id}"
