Using WITH in sql query
Your query can be written without subqueries/joins like that:

UPDATE items
   SET description = replace(description, '#', cast(@num:=@num+1 as char(10))) 
 WHERE parent_id = 159133 
   AND type='photo'
   AND @num := 1       -- @num initialization by Akina
 ORDER BY name ASC
;