If you'll use URL method, most browser will cache images and discard them when you leave page. That's true also for files with no-cache headers (browser need to have images to display them afterall).
Usually purpose of disabling caching is to display several dynapically generated images with the same url on one page and in that case both methods would work.
maybe i can give you more speciffic info if you'll tell why you want to prevent caching