Fix Freeze in Gallery for some devices