Change edit action to use form_for. Use a RESTful resource for pictures in routes.rb.