Show image depending on the number in the custom fields

Better will be when you use css to change status colors.

WooCommerce Hooks: Actions and filters
Action and Filter Hook Reference
woocommerce/templates/content-single-product.php

function woocommerce_stock_badge() {
    global $product;

    if ( !$product->is_in_stock() ) {
        echo '<div class="stock red">no stock</div>';
    } else if ( $product->is_in_stock() && 5 >= $product->get_stock_quantity() ) {
        echo '<div class="stock orange">low stock</div>';
    } else if ( $product->is_in_stock() ) {
        echo '<div class="stock green">in stock</div>';
    }

}

// Add stock status to archive pages
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_stock_badge', 10 );

// Add stock status to single pages
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_stock_badge', 10 );