Get the a specific image from the post gallery linked to post_id

You can get all the images associated with a post with the following:

$args = array(
    'post_type'      => 'attachment',
    'post_mime_type' => 'image',
    'post_parent'    => $post_parent_id // you'll need to set this somewhere else
);
$images = get_children( $args )

To go from that to the 2nd image, you should just need to point to $images[1], but I’m not sure how that’d work, you might needa mess with the sort order a little.