Try moving this code
$attachment_id = get_field('slide_photo');
$size = "medium"; // (thumbnail, medium, large, full or custom size)
$image = wp_get_attachment_image_src( $attachment_id, $size );
into your loop. Outside of the loop, there’s no way to know what get_field('slide_photo')
is referring to.