take a look at sting function, u would be able to do that using a combinataion of substr() and strrpos() and strlen()
for example:
$last_slash_pos = strrpos ( $url, "/" );
$name_jpg = substr($url,$last_slash_pos,strlen($url));
...hope this helps you
😃 J@ystick_FI😃