query to replace text with sequential numbers
Use a variable to get an auto-incremented value and update description using this value. Or use Rick James's answer and add a sequenced column to your table as a number for each picture. 

create table t (name varchar(10), description varchar(100));
insert into t values ('b', '"Photo number # - Gallery name"');
insert into t values ('c', '"Photo number # - Gallery name"');
insert into t values ('a', '"Photo number # - Gallery name"');
insert into t values ('x', '"Photo number # - Gallery name"');




update t
join (select 
          name, @num := @num + 1 as num
      from
          t, (select @num := 0) t
      order by
          name) t2
on t2.name = t.name
set description = replace(description, '#', cast(num as varchar(10)));




select * from t order by name;



name | description                    
:--- | :------------------------------
a    | &quot;Photo number 1 - Gallery name&quot;
b    | &quot;Photo number 2 - Gallery name&quot;
c    | &quot;Photo number 3 - Gallery name&quot;
x    | &quot;Photo number 4 - Gallery name&quot;


db&lt;>fiddle here