Rewraming the Image Gallery URL – Webmaster Batch Exchange

I am using vbulletin and installed photoplog and this is my url:

https://www.mknexusonline.com/gallery/
and that's my category url

https://www.mknexusonline.com/gallery/index.php?n=1025

Rewrite URL I want https://www.mknexusonline.com/gallery/category

and that's my image url

https://www.mknexusonline.com/gallery/images/5/1_mk11-_scorpion-win.jpg

Rewrite Url as follows: https://www.mknexusonline.com/gallery/categoryname/mk-scorpion-win.jpg

now the questions I want to rewrite my image url so

The number 1027 is preset after installing photoplog

and this is already rewritten url. Demo link https://www.pentaxforums.com/gallery/ (not my website) https://www.pentaxforums.com/gallery/travel/ (I would like to rewrite this category)

and rewrite this image URL https://www.pentaxforums.com/gallery/photo-mexican-alebrijes-56660/ (I would like that)