Excuse me but these previews don't seem very secure. They're either cached or directly fetched through the user's connection aren't they? What if they're illegal files?
@Oceane fyi each instance can decide which types of file are allowed to be uploaded (.jpg .png .pdf etc)
wonder if you have in mind specific ways to enhance the security?