Install url shortener on website and QR image.
Build an admin page to retrieve short url and QR image from photos without them.
Make sure if short url and QR image is not available, it will show the original url and a default QR image that I will upload on server.
Make sure it stores short urls in database for each photo and QR images in a folder.
Admin page should have on/off button, a way to change api and a page to retrieve and store short urls/QR images for photos that don't have them.