Corrections on all photo galleries.

The code now is optimized for better results!