Fix bug in image export