add error handling to create_previews
remove debugging output