Fix caching issue while image transformation #4662

* Removed tempfile dependency.
* Fixed caching issue with images.
* Added test for the same.
* Re-factored test.
Merge pull request #7 from tarunbhardwaj/develop

Fix caching issue while image transformation #4662