Repaired gallery layout to work without custom plugin