fixed gallery links parsing