add layout
complete the basic functionalities of grid search image