Gallery and preview from file or datadbase