Fixed issue when downloading images