Adding caching functionality

Added caching functionality from this commit: https://github.com/zroger/jekyll-minimagick/pull/6/files#diff-8e3b08c4e05f9c494a783bd8fdc1e58aR40