center_horizontally method to center any element (like images)