fix undefined method `image_path' for nil:NilClass