add optional duration for images