I think the error message you are getting is due to lack of ' ' around my
Your error log shows:
insert into pic_table
(name, pic)
values
(my, empty_blob())
returning pic into :1
Try '$name' so that that ends up as ('my', empty_blob())