handle image stream better, try to make sure only opened once and properly closed gif image broken until it can be loaded from a stream