Added helper function to release device buffer without destroying the Image.
Used dev_free helper instead of relying on destructor.