fixed preview and preview_online methods in AttachmentsController; some refactoring (added ActiveSupport::Concern)