Don't require a display if filename was set.
Add missing import.