/**
  * Gets image list.
  * @param string $attr owner attribute name.
  * @return array list or error.
  */
 public function run($attr)
 {
     $result = array();
     \Yii::$app->response->format = Response::FORMAT_JSON;
     $model = new File();
     $model->setAttributes(['ownerAttribute' => $attr, 'uploadUrl' => $this->uploadUrl, 'uploadPath' => $this->uploadPath], false);
     $path = $model->getDirPath();
     $url = $model->getDirUrl();
     if (file_exists($path)) {
         foreach (FileHelper::findFiles($path, $this->fileOptions) as $file) {
             $result[] = array('thumb' => $url . basename($file), 'image' => $url . basename($file));
         }
     }
     return $result;
 }