added possibility to store images to external cache dir