Yeah, I see what you mean. When you take that last "/" out, it also winds up matching the re-written URL as well. You might try putting this above that rewrite to make it skip it. The S=# should be the number of following rules to skip. In this case I am skipping 1 rule.
`
RewriteRule ^(.*)\.jpg\.php$ - [S=1]
RewriteRule ^(album1|album2)/(.*)$ $1/$2.jpg.php? [NC,R=301,L]
`
Hope that works.