Hadn’t thought of that. I [opened up a JSFiddle] to play around with it.
Your implementation only works if your image’s container has a fixed width or if it has a percentage based width of 100%.
If say the container has a 40% width then the image will only take of 40% of its container.
I’m not saying don’t use inherit – just to be aware of that behavior.