If you want to normalize each image in isolation, this code should work:
N, C, H, W = 2, 3, 5, 5
x = torch.randn(N, C, H, W)

tmp = x.view(N, C, -1)
min_vals = tmp.min(2, keepdim=True).values
tmp = (tmp - min_vals) / max_vals
max_vals = tmp.max(2, keepdim=True).values
tmp = tmp / max_vals

x = tmp.view(x.size())

for n in range(N):
    for c in range(C):
        x_ = x[n, c]
        print(n, c, x_.shape, x_.min(), x_.max())

> 0 0 torch.Size([5, 5]) tensor(0.) tensor(1.)
0 1 torch.Size([5, 5]) tensor(0.) tensor(1.)
0 2 torch.Size([5, 5]) tensor(0.) tensor(1.)
1 0 torch.Size([5, 5]) tensor(0.) tensor(1.)
1 1 torch.Size([5, 5]) tensor(0.) tensor(1.)
1 2 torch.Size([5, 5]) tensor(0.) tensor(1.)