type ahead and sql on manage photo