make image preview backend work with encryption