add feature to delete method in image

@image.imageable.images.where.not(id: params[:id].to_i).first.update_attribute('main', true)