lua : add a field indicating if the autopresets have been applied
lua : fix ipairs not working properly

this issue only affected master. no backport needed
lua : add a function to reset an image, removing all history


dt_lua_image_t:reset()