Thumbnail for Album don't work

Work
$gallery = $f->photosets_getList($id);
foreach($gallery['photoset'] as $photo) {
    <img src="<?php echo $f->buildPhotoURL($photo, 'small');?>">