convert object_label to string

Will exception If object have label as id
For example i have 2 models

class Product < ActiveRecord::Base
  has_many :photos, dependent: :destroy
  accepts_nested_attributes_for :photos, allow_destroy: true
  .....

class Photo
  belongs_to :product
  ....

model Photo have only two attributes: id, image
We get the following exception when open editing Product model

undefined method `gsub' for 1:Fixnum