Website loading slowly – Advanced Custom Fields images

I have managed to work it out – the function was leading to a lot of queries, so I rewrote it as follows:

    $housePhotos = get_post_custom_values('house_photos');

    $housePhotos = explode(';',$housePhotos[0]);

    preg_match_all('`"([^"]*)"`', $housePhotos[1], $results);

    $imageURL = wp_get_attachment_image_src( $results[1][0], 'house_search' );

    if (!empty($results[1][0])) {

        echo '<img src="' . $imageURL[0] .'" alt="" />'; 

    }