docs: function getTopImages(params, config, conn) {
  
  
    // defaults
    config = config || require('../config/config.js')
  
    var limit = 10
    if (!isNaN(params.limit)) {
      limit = params.limit
    }
  
  
    // main
    return new Promise((resolve, reject) => {
  
      if (!conn) {
        var conn = wc_db.getConnection(config.db)
      }
  
      var sql
      if (params.reviewer) {
        sql = 'SELECT * from Rating where reviewer = :reviewer order by rating DESC LIMIT :limit '
      } else {
        sql = 'SELECT uri, avg(rating) rating from Rating group by uri order by rating DESC LIMIT :limit '
      }
  
      conn.query(sql, { replacements: { "reviewer" : params.reviewer, "limit" : params.limit } }).then(function(ret){
        return resolve({"ret" : ret, "conn" : conn})
      }).catch(function(err) {
        return reject({"err" : err, "conn" : conn})
      })
  
    })
  
  }