Added cleanup and error catching around OutOfMemoryError during image download