# Implements flickr.photos.getRecent and flickr.photos.search
def photos(*criteria)
photos = (criteria[0]) ? photos_search(criteria[0]) : photos_getRecent
photo_collection = photos['photos']['photo']
# if only one photo, there's no array of photos; create the one photo
return [Photo.new(photo_collection['id'])] unless photo_collection.kind_of? Array
# otherwise, create all the photos
photo_collection.collect { |photo| Photo.new(photo['id']) }
end