lua api : forgot a closing tag in a list
make sure image is generated before creating a snapshot