Fix for buttons bug in galleries in Safari