added posibility to set max number for slides