 
 generateThumb = (fname, hash, cb) ->
     # Create the cache folder if it doesn't exist yet
+    if fs.existsSync path.join('release', settings.deployDir, 'cache', "th_#{hash}.jpg")
+        console.log "Thumbnail for #{fname} already exists, skipping..."
+        return cb()
+
     fs.mkdir path.join('release', settings.deployDir, 'cache'), (err) ->
         if err?
             return cb err if err.code != 'EEXIST'

                    _.contains changed, fname

                getFileHashes changed, (err, hashes) ->
                    # Add the new files' hash-file relations in, completing the current relation sheet
                    current = _.merge current, hashes


        , settings.scannerConcurrency

        thumbQueue.drain = ->
            return cb errors if errors.length > 0

            relations = current

            console.log "Now syncing database... (adding #{_.keys(add).length}, removing #{del.length}, updating #{_.keys(mov).length})"
            if _.keys(add).length + del.length + _.keys(mov).length > 100
                console.log "Seems like there are quite a bit of changes, so this may take some time."

            db.parallelize ->
                stmtAdd = db.prepare "INSERT INTO tFile (hash, locator, name, size, timestamp) VALUES (?, ?, ?, ?, ?)"
