null url handling in gallery template