If the build completes immediately, then whatever change you made didn’t change the evaluation and resulting derivation. Aka, it is building the image you requested, it just happens to already be built.
Generally you don’t really ever, ever need to use --rebuild unless you’re dealing with a flaky build failure (even then, you shouldn’t need it), or if you’re trying to check reproducibility by building again.
That all said, --rebuild will generally trigger a rebuild, but it might only be of the toplevel derivation which might be like a simple compression for the pi image, etc.
There’s no easy way to rebuild everything in the dependency graph for the derivation you’re trying to rebuild. nix build nixpkgs#hello --rebuild will only build hello-world for example, it won’t rebuild glibc, or gcc (the inputs).
If you want that to happen, a quick way to do it is:
Nix bugs notwithstanding, this should truly rebuild everything in the dependency graph from source once again, in a new nix store without any substituters, make sure to get rid of ./tmpstore when you’re done as it may take up a ton of space.