Q:

WordPress custom image gallery linking to custom image size

I'm creating a custom image gallery shortcode that opens the images in a lightbox. The line that outputs the images is: 
$image_output = "<a href='" . wp_get_attachment_url( $id )  . "' data-toggle='lightbox' data-gallery='$selector' data-footer='$attachment->post_excerpt'> " . wp_get_attachment_image($id, $atts['size'], false, $attr ) . "</a>";

Everything works great except this links to the original (and full size) image. I want it to instead link to a custom image size. I tried wp_get_attachment_url( $id ) with wp_get_attachment_image_src( $id, 'gallery-thumbnail', false ).
However, instead of getting the desired image url I get Array. Any ideas what I'm doing wrong? Should be using something else?

A:

wp_get_attachment_image_src() returns an array (url, width, height) so use
wp_get_attachment_image_src(...)[0]

