Avoid redundant warning when encoding NumPy array as `Image`
Avoid a redundant warning in `encode_np_array` by removing the identity check as NumPy `dtype`s can be equal without having identical `id`s.

Additionally, fix "unreachable" checks in `encode_np_array`.