function photo_thumbnail_tag($entity, $entity_id, $options = array()) { if (!is_array($options)) { $options = array(); } if (photo_has_gallery($entity, $entity_id)) { return image_tag('/' . sfConfig::get('sf_upload_dir_name') . '/thumbnails/' . sfPhotoGalleryPeer::getFirst($entity, $entity_id), $options); } return image_tag('nopicture.jpg', $options); }