Fix for partial images being downloaded and saved