     }
 
     private var previewTransitionViews: [UIView?]?
+    private var previewAttachmentPhotos: [PreviewAttachmentPhoto] = []
 
     deinit {
         NSNotificationCenter.defaultCenter().removeObserver(self)

extension ConversationViewController: PhotosViewControllerDelegate {

    func photosViewController(vc: PhotosViewController, referenceViewForPhoto photo: Photo) -> UIView? {
        return (previewTransitionViews?.first)!
    }

    func photosViewController(vc: PhotosViewController, didNavigateToPhoto photo: Photo, atIndex index: Int) {

            self?.previewTransitionViews = transitionViews

            let previewAttachmentPhotos = attachments.map({ PreviewAttachmentPhoto(attachment: $0) })
            previewAttachmentPhotos[index].image = image

            self?.previewAttachmentPhotos = previewAttachmentPhotos

            let photos: [Photo] = previewAttachmentPhotos.map({ $0 })
            let initialPhoto = photos[index]

            let photosViewController = PhotosViewController(photos: photos, initialPhoto: initialPhoto, delegate: self)
            self?.presentViewController(photosViewController, animated: true, completion: nil)
