This is done by the "Gallery Grid" Shortcode when you select "classic" Grid layout!
a5 Caption
Caption t5
Name:
Email:
Enter Your Message Here...