Support events without end date and effect gallery rows and columns number

#4347