Migrate some functions from librairy/utils to librairy/models (previews
generations, metadatas loading, previews and file deletion)