join query for 18 images