     unless nextProps.tutorial is @props.tutorial
       @fetchMediaFor nextProps.tutorial
 
-  fetchMediaFor: (tutorial) ->
-    tutorial.get 'attached_images', {}
-      .then (mediaResources) =>
-        mediaByID = {}
-        for mediaResource in mediaResources
-          mediaByID[mediaResource.id] = mediaResource
-        @setState media: mediaByID
-
   render: ->
     <TutorialEditor
       tutorial={@props.tutorial}
-      media={@state.media}
-      onStepAdd={@handleAddStep}
+      media={@props.media}
+      onStepAdd={@handleStepAdd}
       onStepRemove={@handleStepRemove}
       onMediaSelect={@handleStepMediaChange}
       onMediaClear={@handleStepMediaClear}
       onStepChange={@handleStepChange}
     />
 
-  handleAddStep: ->
+  handleStepAdd: ->
     @props.tutorial.steps.push
       media: ''
       content: ''

      loading: true
      error: null
      tutorial: null
    apiClient.type('tutorials').get project_id: @props.project?.id
      .then ([tutorial]) =>
        @setState {tutorial}
      .catch (error) =>
        @setState {error}
      .then =>
        @setState loading: false

  render: ->
    if @state.loading

  getDefaultProps: ->
    project: null
    tutorial: null
    media: {}
    delayBeforeSave: 5000

    onDelete: ->
      console.log 'TutorialEditorController onDelete', arguments

  componentDidMount: ->
    @_boundForceUpdate = @forceUpdate.bind this
    @props.tutorial.listen @_boundForceUpdate

