           height: @__resizedHeight
         .appendTo @__widgetElement
 
-    __calcImgSizes: (size) ->
-      @__originalSize = size
-      [@__resizedWidth, @__resizedHeight] =
-        utils.fitSize @__originalSize, [@__widgetWidth, @__widgetHeight]
-
-    __widgetSize: ->
-      @__options.widgetSize or [@container.width(), @container.height()]
+    __calcSizes: (originalSize) ->
+      @__originalSize = originalSize
+      widgetSize = @__options.widgetSize or [@container.width(), @container.height()]
+      [@__resizedWidth, @__resizedHeight] = utils.fitSize @__originalSize, widgetSize
 
     #             |
     #             v

      @__setState 'waiting'

    __setImage: (@__url) ->
      @__deferred = $.Deferred()
      @__img = $('<img/>')
        .css
          margin: '0 auto'

            if downscale or upscale
              resized = @__options.preferedSize
            else
              resized = utils.fitSizeInCdnLimit [coords.width, coords.height]

            if resized[0] isnt coords.width or resized[1] isnt coords.height
              [opts.crop.sw, opts.crop.sh] = resized
