Fixed bug in GA for image generation