         id = @getIdPhoto()
         orientation = @collection.get(id)?.attributes.orientation
         newOrientation =
-            helpers.rotateRight orientation, $('.wrapper img.zoomable')
-        helpers.rotate newOrientation, $('.wrapper img.zoomable')
+            helpers.rotateRight orientation, $('.wrapper img')
+        helpers.rotate newOrientation, $('.wrapper img')
         @collection.get(id)?.save orientation: newOrientation,
             success : () ->
                 helpers.rotate newOrientation, $('.pbThumbs .active img')

    # Extract photo id from its URL. It's useful to get the id of the current
    # picture when the user browses them via photobox.
    getIdPhoto: (url) ->
        url ?= $('#pbOverlay .wrapper img.zoomable').attr 'src'
        parts = url.split('/')
        id = parts[parts.length - 1]
        id = id.split('.')[0]

        id = @getIdPhoto()
        orientation = @collection.get(id)?.attributes.orientation
        newOrientation =
            helpers.rotateLeft orientation, $('.wrapper img')
        helpers.rotate newOrientation, $('.wrapper img')
        @collection.get(id)?.save orientation: newOrientation,
            success : () ->
                helpers.rotate newOrientation, $('.pbThumbs .active img')
