Clean generate_image(), prevent upscaling