fixed permissions when caching downloaded image locally