Fix pages deployment storage migration

What does this MR do?

Fixed #334004 (closed)

See comments on code

Since we ask people to migrate to new architecture in 13.12 and 14.0, this fix should be backported to allow users to follow step in https://docs.gitlab.com/ee/administration/pages/#migrate-gitlab-pages-to-140

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #334004 (closed)

Edited by Vladimir Shushlin